本文整理了Java中com.jme3.math.Quaternion.clone
方法的一些代码示例,展示了Quaternion.clone
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Quaternion.clone
方法的具体详情如下:
包路径:com.jme3.math.Quaternion
类名称:Quaternion
方法名:clone
暂无
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
@Override
public Transform clone() {
try {
Transform tq = (Transform) super.clone();
tq.rot = rot.clone();
tq.scale = scale.clone();
tq.translation = translation.clone();
return tq;
} catch (CloneNotSupportedException e) {
throw new AssertionError();
}
}
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
public Listener(Listener source){
location = source.location.clone();
velocity = source.velocity.clone();
rotation = source.rotation.clone();
volume = source.volume;
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
/**
* Special-purpose copy constructor.
* <p>
* Only copies the name, user control state and bind pose transforms from the original.
* <p>
* The rest of the data is <em>NOT</em> copied, as it will be
* generated automatically when the bone is animated.
*
* @param source The bone from which to copy the data.
*/
Bone(Bone source) {
this.name = source.name;
userControl = source.userControl;
bindPos = source.bindPos.clone();
bindRot = source.bindRot.clone();
bindScale = source.bindScale.clone();
modelBindInversePos = source.modelBindInversePos.clone();
modelBindInverseRot = source.modelBindInverseRot.clone();
modelBindInverseScale = source.modelBindInverseScale.clone();
// parent and children will be assigned manually..
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
/**
* Sets the transform for the given frame.
*
* @param frameIndex
* the frame for which the transform will be set
* @param transform
* the transformation to be set
*/
public void setTransform(int frameIndex, Transform transform) {
if (translations == null) {
translations = this.createList(Vector3f.ZERO, frameIndex);
}
this.append(translations, Vector3f.ZERO, frameIndex - translations.size());
translations.add(transform.getTranslation().clone());
if (rotations == null) {
rotations = this.createList(Quaternion.IDENTITY, frameIndex);
}
this.append(rotations, Quaternion.IDENTITY, frameIndex - rotations.size());
rotations.add(transform.getRotation().clone());
if (scales == null) {
scales = this.createList(Vector3f.UNIT_XYZ, frameIndex);
}
this.append(scales, Vector3f.UNIT_XYZ, frameIndex - scales.size());
scales.add(transform.getScale().clone());
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
@Override
public Camera clone() {
try {
Camera cam = (Camera) super.clone();
cam.viewportChanged = true;
cam.planeState = 0;
cam.worldPlane = new Plane[MAX_WORLD_PLANES];
for (int i = 0; i < worldPlane.length; i++) {
cam.worldPlane[i] = worldPlane[i].clone();
}
cam.coeffLeft = new float[2];
cam.coeffRight = new float[2];
cam.coeffBottom = new float[2];
cam.coeffTop = new float[2];
cam.location = location.clone();
cam.rotation = rotation.clone();
if (projectionMatrixOverride != null) {
cam.projectionMatrixOverride = projectionMatrixOverride.clone();
}
cam.viewMatrix = viewMatrix.clone();
cam.projectionMatrix = projectionMatrix.clone();
cam.viewProjectionMatrix = viewProjectionMatrix.clone();
cam.guiBounding = (BoundingBox) guiBounding.clone();
cam.update();
return cam;
} catch (CloneNotSupportedException ex) {
throw new AssertionError();
}
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
Quaternion initRotation = model.getLocalRotation().clone();
initScale = model.getLocalScale().clone();
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
Quaternion initRotation = model.getLocalRotation().clone();
initScale = model.getLocalScale().clone();
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
break;
case Rotation:
rotations[j] = ((Quaternion) ((Rotation) keyFrames[i]).rotation).clone();
break;
case Scale:
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
targetAngles = targetTransform.getRotation().toAngles(targetAngles);
Quaternion startRotation = ownerRotation.clone();
Quaternion offset = Quaternion.IDENTITY;
if ((flag & ROTLIKE_OFFSET) != 0) {// we add the original rotation to
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
link.initalWorldRotation = bone.getModelSpaceRotation().clone();
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
link.initalWorldRotation = bone.getModelSpaceRotation().clone();
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
public void read(JmeImporter e) throws IOException {
InputCapsule capsule = e.getCapsule(this);
location = (Vector3f) capsule.readSavable("location", Vector3f.ZERO.clone());
rotation = (Quaternion) capsule.readSavable("rotation", Quaternion.DIRECTION_Z.clone());
frustumNear = capsule.readFloat("frustumNear", 1);
frustumFar = capsule.readFloat("frustumFar", 2);
frustumLeft = capsule.readFloat("frustumLeft", -0.5f);
frustumRight = capsule.readFloat("frustumRight", 0.5f);
frustumTop = capsule.readFloat("frustumTop", 0.5f);
frustumBottom = capsule.readFloat("frustumBottom", -0.5f);
coeffLeft = capsule.readFloatArray("coeffLeft", new float[2]);
coeffRight = capsule.readFloatArray("coeffRight", new float[2]);
coeffBottom = capsule.readFloatArray("coeffBottom", new float[2]);
coeffTop = capsule.readFloatArray("coeffTop", new float[2]);
viewPortLeft = capsule.readFloat("viewPortLeft", 0);
viewPortRight = capsule.readFloat("viewPortRight", 1);
viewPortTop = capsule.readFloat("viewPortTop", 1);
viewPortBottom = capsule.readFloat("viewPortBottom", 0);
width = capsule.readInt("width", 1);
height = capsule.readInt("height", 1);
name = capsule.readString("name", null);
onFrustumChange();
onViewPortChange();
onFrameChange();
}
}
代码示例来源:origin: jMonkeyEngine-Contributions/Lemur
public RotateSpatial( Spatial target, Quaternion from, Quaternion to, double length ) {
super(length);
this.target = target;
this.from = from.clone();
this.to = to.clone();
this.value = from.clone();
}
代码示例来源:origin: jMonkeyEngine-Contributions/Lemur
public RotateCamera( Camera target, Quaternion from, Quaternion to, double length ) {
super(length);
this.target = target;
this.from = from.clone();
this.to = to.clone();
this.value = from.clone();
}
代码示例来源:origin: info.projectkyoto/mms-engine
@Override
public Transform clone() {
try {
Transform tq = (Transform) super.clone();
tq.rot = rot.clone();
tq.scale = scale.clone();
tq.translation = translation.clone();
return tq;
} catch (CloneNotSupportedException e) {
throw new AssertionError();
}
}
}
代码示例来源:origin: org.jmonkeyengine/jme3-core
@Override
public Transform clone() {
try {
Transform tq = (Transform) super.clone();
tq.rot = rot.clone();
tq.scale = scale.clone();
tq.translation = translation.clone();
return tq;
} catch (CloneNotSupportedException e) {
throw new AssertionError();
}
}
}
代码示例来源:origin: info.projectkyoto/mms-engine
public Listener(Listener source){
location = source.location.clone();
velocity = source.velocity.clone();
rotation = source.rotation.clone();
volume = source.volume;
}
代码示例来源:origin: org.jmonkeyengine/jme3-core
public Listener(Listener source){
location = source.location.clone();
velocity = source.velocity.clone();
rotation = source.rotation.clone();
volume = source.volume;
}
代码示例来源:origin: tonihele/OpenKeeper
public PossessionCameraControl(Camera camera, Direction direction) {
this.camera = camera;
this.direction = direction;
if (direction == Direction.ENTRANCE) {
qFrom = camera.getRotation().clone();
pFrom = camera.getLocation().clone();
} else {
qTo = camera.getRotation().clone();
pTo = camera.getLocation().clone();
}
}
代码示例来源:origin: tonihele/OpenKeeper
@Override
public void setSpatial(Spatial spatial) {
super.setSpatial(spatial);
if (spatial != null) {
if (direction == Direction.ENTRANCE) {
qTo = spatial.getLocalRotation().clone();
pTo = spatial.getLocalTranslation().clone();
} else {
qFrom = spatial.getLocalRotation().clone();
pFrom = spatial.getLocalTranslation().clone();
}
}
}
内容来源于网络,如有侵权,请联系作者删除!