use of com.jme3.scene.Spatial in project jmonkeyengine by jMonkeyEngine.
the class BulletJointDebugControl method setSpatial.
@Override
public void setSpatial(Spatial spatial) {
if (spatial != null && spatial instanceof Node) {
Node node = (Node) spatial;
node.attachChild(geomA);
node.attachChild(geomB);
} else if (spatial == null && this.spatial != null) {
Node node = (Node) this.spatial;
node.detachChild(geomA);
node.detachChild(geomB);
}
super.setSpatial(spatial);
}
use of com.jme3.scene.Spatial in project jmonkeyengine by jMonkeyEngine.
the class BulletRigidBodyDebugControl method setSpatial.
@Override
public void setSpatial(Spatial spatial) {
if (spatial != null && spatial instanceof Node) {
Node node = (Node) spatial;
node.attachChild(geom);
} else if (spatial == null && this.spatial != null) {
Node node = (Node) this.spatial;
node.detachChild(geom);
}
super.setSpatial(spatial);
}
use of com.jme3.scene.Spatial in project jmonkeyengine by jMonkeyEngine.
the class BulletVehicleDebugControl method setSpatial.
@Override
public void setSpatial(Spatial spatial) {
if (spatial != null && spatial instanceof Node) {
Node node = (Node) spatial;
node.attachChild(suspensionNode);
} else if (spatial == null && this.spatial != null) {
Node node = (Node) this.spatial;
node.detachChild(suspensionNode);
}
super.setSpatial(spatial);
}
use of com.jme3.scene.Spatial in project jmonkeyengine by jMonkeyEngine.
the class CollisionShapeFactory method createSingleMeshShape.
/**
* This type of collision shape is mesh-accurate and meant for immovable "world objects".
* Examples include terrain, houses or whole shooter levels.<br>
* Objects with "mesh" type collision shape will not collide with each other.
*/
private static MeshCollisionShape createSingleMeshShape(Geometry geom, Spatial parent) {
Mesh mesh = geom.getMesh();
Transform trans = getTransform(geom, parent);
if (mesh != null && mesh.getMode() == Mesh.Mode.Triangles) {
MeshCollisionShape mColl = new MeshCollisionShape(mesh);
mColl.setScale(trans.getScale());
return mColl;
} else {
return null;
}
}
use of com.jme3.scene.Spatial in project jmonkeyengine by jMonkeyEngine.
the class CollisionShapeFactory method createSingleDynamicMeshShape.
/**
* This method creates a hull collision shape for the given mesh.<br>
*/
private static HullCollisionShape createSingleDynamicMeshShape(Geometry geom, Spatial parent) {
Mesh mesh = geom.getMesh();
Transform trans = getTransform(geom, parent);
if (mesh != null) {
HullCollisionShape dynamicShape = new HullCollisionShape(mesh);
dynamicShape.setScale(trans.getScale());
return dynamicShape;
} else {
return null;
}
}
Aggregations