public void setSpatial(Spatial spatial) { this.spatial = spatial; setUserObject(spatial); if (spatial == null) { return; } setPhysicsLocation(getSpatialTranslation()); }
/** * Move the character somewhere. Note the character also warps to the * location of the spatial when the control is added. * * @param vec the desired character location (not null) */ public void warp(Vector3f vec) { setPhysicsLocation(vec); }
/** * Put the control into Kinematic mode. In this mode, the collision shapes * follow the movements of the skeleton while interacting with the physics * environment. */ public void setKinematicMode() { if (mode != Mode.Kinematic) { setMode(Mode.Kinematic); } }
/** * Alter which spatial is controlled. * * @param spatial spatial to control (or null) */ public void setSpatial(Spatial spatial) { this.spatial = spatial; setUserObject(spatial); if (spatial == null) { return; } setPhysicsLocation(getSpatialTranslation()); setPhysicsRotation(getSpatialRotation()); }
/** * Update this control. Invoked once per frame during the logical-state * update, provided the control is added to a scene. Do not invoke directly * from user code. * * @param tpf the time interval between frames (in seconds, ≥0) */ public void update(float tpf) { if (!enabled) { return; } setPhysicsLocation(getSpatialTranslation()); setPhysicsRotation(getSpatialRotation()); }
/** * Create a shallow clone for the JME cloner. * * @return a new control (not null) */ @Override public Object jmeClone() { BetterCharacterControl control = new BetterCharacterControl(radius, height, mass); control.setJumpForce(jumpForce); control.spatial = this.spatial; return control; }
/** * Rebuild the ragdoll. This is useful if you applied scale on the ragdoll * after it was initialized. Same as re-attaching. */ public void reBuild() { if (spatial == null) { return; } removeSpatialData(spatial); createSpatialData(spatial); }
/** * Render this control. Invoked once per view port per frame, provided the * control is added to a scene. Should be invoked only by a subclass or by * the RenderManager. * * @param rm the render manager (not null) * @param vp the view port to render (not null) */ @Override public void render(RenderManager rm, ViewPort vp) { super.render(rm, vp); }
/** * Alter which spatial is controlled. * * @param spatial spatial to control (or null) */ public void setSpatial(Spatial spatial) { this.spatial = spatial; setUserObject(spatial); if (spatial == null) { return; } setPhysicsLocation(getSpatialTranslation()); setPhysicsRotation(getSpatialRotation()); }
/** * Update this control. Invoked once per frame during the logical-state * update, provided the control is added to a scene. Do not invoke directly * from user code. * * @param tpf the time interval between frames (in seconds, ≥0) */ public void update(float tpf) { if (!enabled) { return; } setPhysicsLocation(getSpatialTranslation()); setPhysicsRotation(getSpatialRotation()); }
public void setSpatial(Spatial spatial) { this.spatial = spatial; setUserObject(spatial); if (spatial == null) { return; } setPhysicsLocation(getSpatialTranslation()); }
/** * Sets the control into Ragdoll mode The skeleton is entirely controlled by * physics. */ public void setRagdollMode() { if (mode != Mode.Ragdoll) { setMode(Mode.Ragdoll); } }
/** * Create a shallow clone for the JME cloner. * * @return a new control (not null) */ @Override public Object jmeClone() { BetterCharacterControl control = new BetterCharacterControl(radius, height, mass); control.setJumpForce(jumpForce); control.spatial = this.spatial; return control; }
/** * Rebuild the ragdoll. This is useful if you applied scale on the ragdoll * after it was initialized. Same as re-attaching. */ public void reBuild() { if (spatial == null) { return; } removeSpatialData(spatial); createSpatialData(spatial); }
/** * Move the character somewhere. Note the character also warps to the * location of the spatial when the control is added. * * @param vec the desired character location (not null) */ public void warp(Vector3f vec) { setPhysicsLocation(vec); }
/** * Render this control. Invoked once per view port per frame, provided the * control is added to a scene. Should be invoked only by a subclass or by * the RenderManager. * * @param rm the render manager (not null) * @param vp the view port to render (not null) */ @Override public void render(RenderManager rm, ViewPort vp) { super.render(rm, vp); }
/** * Sets the control into Inverse Kinematics mode. The affected bones are * affected by IK. physics. */ public void setIKMode() { if (mode != Mode.IK) { setMode(Mode.IK); } }
/** * Put the control into Kinematic mode. In this mode, the collision shapes * follow the movements of the skeleton while interacting with the physics * environment. */ public void setKinematicMode() { if (mode != Mode.Kinematic) { setMode(Mode.Kinematic); } }
/** * Sets the control into Ragdoll mode The skeleton is entirely controlled by * physics. */ public void setRagdollMode() { if (mode != Mode.Ragdoll) { setMode(Mode.Ragdoll); } }
/** * Sets the control into Inverse Kinematics mode. The affected bones are * affected by IK. physics. */ public void setIKMode() { if (mode != Mode.IK) { setMode(Mode.IK); } }