Package net.cis.client.game.scenery.ctrl

Source Code of net.cis.client.game.scenery.ctrl.SpatialUpdater

package net.cis.client.game.scenery.ctrl;

import net.cis.client.game.common.model.co.ControlledSpaceObject;
import net.cis.client.game.common.threading.IGameThreadCallback;

import com.jme3.scene.Spatial;

public class SpatialUpdater implements IGameThreadCallback {

  protected ControlledSpaceObject controlledSpaceObject;

  public SpatialUpdater(ControlledSpaceObject controlledSpaceObject) {
    this.controlledSpaceObject = controlledSpaceObject;

  }

  @Override
  public float getUpdateTime() {
    return 1/60f;
  }

  @Override
  public void simpleUpdate(float tpf, float time) {
    Spatial spatial = controlledSpaceObject.getSceneObject();

    // TODO: dirty flag
    // if(!controlledObject.spaceObject.isDirty())
    // return;

    spatial.setLocalRotation(controlledSpaceObject.dataObject.getRotation());
    spatial.setLocalTranslation(controlledSpaceObject.dataObject.getLocation());
   
    // TODO: Still needed: scale, transform, lodLevel, material / mesh updates

  }

}
TOP

Related Classes of net.cis.client.game.scenery.ctrl.SpatialUpdater

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.