public Bits getVisibleLayers(Bits out) { out.clear(); out.or(visibleLayers); return out; }
@Override public void notifyLayerChanged(Bits layer) { visibleLayers.clear(); visibleLayers.or(layer); updateModelCache(visibleLayers); }
@Override public void notifyEntitySelected(GameCharacter entity) { selectedCharacter = entity; markerBillboard.setFollowTransform(entity.motionState.transform, entity.selectionMarkerOffset); markerBillboard.visibleOnLayers.clear(); markerBillboard.visibleOnLayers.or(entity.visibleOnLayers); }
public void setVisibleLayers(Bits visibleLayers) { this.visibleLayers.clear(); this.visibleLayers.or(visibleLayers); layerController.setLayer(visibleLayers.nextClearBit(0) - 1); notifyObserversLayerChanged(this.visibleLayers); } }
public Stick spawnStick(String sharedBlueprintId, Vector3 initialPosition) { GameObjectBlueprint bp = sharedBlueprints.get(sharedBlueprintId); Stick obj = new Stick( bp.model, bp.name, initialPosition, bp.rotation, bp.scale, bp.shape, bp.mass, bp.belongsToFlag, bp.collidesWithFlag, bp.callback, bp.noDeactivate); obj.visibleOnLayers.clear(); obj.visibleOnLayers.or(bp.visibleOnLayers); addGameObject(obj); return obj; }
public GameModelBody spawnGameModelBody(GameObjectBlueprint bp, Vector3 initialPosition) { GameModelBody obj = new GameModelBody( bp.model, bp.name, initialPosition, bp.rotation, bp.scale, bp.shape, bp.mass, bp.belongsToFlag, bp.collidesWithFlag, bp.callback, bp.noDeactivate); obj.visibleOnLayers.clear(); obj.visibleOnLayers.or(bp.visibleOnLayers); if (bp.name.startsWith("door")) { btHingeConstraint hinge = new btHingeConstraint( obj.body, new Vector3(0, 0, -obj.halfExtents.z), Vector3.Y); hinge.enableAngularMotor(true, 0, 0.1f); obj.constraints.add(hinge); } addGameObject(obj); return obj; }
GameModel obj = new GameModel(bp.model, bp.name, bp.position, bp.rotation, bp.scale); obj.visibleOnLayers.clear(); obj.visibleOnLayers.or(bp.visibleOnLayers); addGameObject(obj); return obj;