本文整理了Java中com.jme3.math.Transform.getTranslation()
方法的一些代码示例,展示了Transform.getTranslation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transform.getTranslation()
方法的具体详情如下:
包路径:com.jme3.math.Transform
类名称:Transform
方法名:getTranslation
[英]Return the translation vector in this matrix.
[中]
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
/**
* <code>getLocalTranslation</code> retrieves the local translation of
* this node.
*
* @return the local translation of this node.
*/
public Vector3f getLocalTranslation() {
return localTransform.getTranslation();
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
public Vector3f getLocalTranslation() {
return localTransform.getTranslation();
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
/**
* @return the physicsLocation
*/
public Vector3f getPhysicsLocation() {
gObject.getWorldTransform(tempTrans);
Converter.convert(tempTrans.origin, physicsLocation.getTranslation());
return physicsLocation.getTranslation();
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
/**
* @return the physicsLocation
*/
public Vector3f getPhysicsLocation() {
gObject.getWorldTransform(tempTrans);
Converter.convert(tempTrans.origin, physicsLocation.getTranslation());
return physicsLocation.getTranslation();
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
/**
* <code>getWorldTranslation</code> retrieves the absolute translation of
* the spatial.
*
* @return the Spatial's world translation vector.
*/
public Vector3f getWorldTranslation() {
checkDoTransformUpdate();
return worldTransform.getTranslation();
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
/**
* Translates the spatial by the given translation vector.
*
* @return The spatial on which this method is called, e.g <code>this</code>.
*/
public Spatial move(Vector3f offset) {
this.localTransform.getTranslation().addLocal(offset);
setTransformRefresh();
return this;
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
/**
* @return the physicsLocation
*/
public Vector3f getPhysicsLocation(Vector3f trans) {
if (trans == null) {
trans = new Vector3f();
}
gObject.getWorldTransform(tempTrans);
Converter.convert(tempTrans.origin, physicsLocation.getTranslation());
return trans.set(physicsLocation.getTranslation());
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
/**
* @return the physicsLocation
*/
public Vector3f getPhysicsLocation(Vector3f trans) {
if (trans == null) {
trans = new Vector3f();
}
gObject.getWorldTransform(tempTrans);
Converter.convert(tempTrans.origin, physicsLocation.getTranslation());
return trans.set(physicsLocation.getTranslation());
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
/**
* Translates the spatial by the given translation vector.
*
* @return The spatial on which this method is called, e.g <code>this</code>.
*/
public Spatial move(float x, float y, float z) {
this.localTransform.getTranslation().addLocal(x, y, z);
setTransformRefresh();
return this;
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
public static com.bulletphysics.linearmath.Transform convert(com.jme3.math.Transform in, com.bulletphysics.linearmath.Transform out) {
convert(in.getTranslation(), out.origin);
convert(in.getRotation(), out.basis);
return out;
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
public static com.jme3.math.Transform convert(com.bulletphysics.linearmath.Transform in, com.jme3.math.Transform out) {
convert(in.origin, out.getTranslation());
convert(in.basis, out.getRotation());
return out;
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
public Bone getJmeBone() {
if (bone == null) {
bone = new Bone(name);
bone.setBindTransforms(jmeLocalBindPose.getTranslation(),
jmeLocalBindPose.getRotation(),
jmeLocalBindPose.getScale());
}
return bone;
}
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
private void dumpScene(Spatial s, int indent) {
System.err.println(indentString.substring(0, indent) + s.getName() + " (" + s.getClass().getSimpleName() + ") / " +
s.getLocalTransform().getTranslation().toString() + ", " +
s.getLocalTransform().getRotation().toString() + ", " +
s.getLocalTransform().getScale().toString());
if (s instanceof Node) {
Node n = (Node) s;
for (Spatial spatial : n.getChildren()) {
dumpScene(spatial, indent + 1);
}
}
}
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
public DTransform(Transform transform) {
translation = new Vector3d(transform.getTranslation());
rotation = new DQuaternion(transform.getRotation());
scale = new Vector3d(transform.getScale());
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
/**
* Adds a key frame for the given Transform at the given keyFrame index
* @param keyFrameIndex the index at which the keyFrame must be inserted
* @param transform the transforms to use for this keyFrame
*/
public void addKeyFrameTransform(int keyFrameIndex, Transform transform) {
addKeyFrameTranslation(keyFrameIndex, transform.getTranslation());
addKeyFrameScale(keyFrameIndex, transform.getScale());
addKeyFrameRotation(keyFrameIndex, transform.getRotation());
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
/**
* Returns the local transform of this bone combined with the given position and rotation
* @param position a position
* @param rotation a rotation
*/
public Transform getCombinedTransform(Vector3f position, Quaternion rotation) {
if(tmpTransform == null){
tmpTransform = new Transform();
}
rotation.mult(localPos, tmpTransform.getTranslation()).addLocal(position);
tmpTransform.setRotation(rotation).getRotation().multLocal(localRot);
return tmpTransform;
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
@Override
public void updateGeometricState() {
super.updateGeometricState();
if (channel < 0 || this.getParent() == null) return;
Vector3f currentWorldTranslation = worldTransform.getTranslation();
if (!previousWorldTranslation.equals(currentWorldTranslation)) {
getRenderer().updateSourceParam(this, AudioParam.Position);
if (velocityFromTranslation && !Float.isNaN(previousWorldTranslation.x)) {
velocity.set(currentWorldTranslation).subtractLocal(previousWorldTranslation).multLocal(1f / lastTpf);
getRenderer().updateSourceParam(this, AudioParam.Velocity);
}
previousWorldTranslation.set(currentWorldTranslation);
}
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
private void dumpScene(Spatial s, int indent) {
System.err.println(indentString.substring(0, indent) + s.getName() + " (" + s.getClass().getSimpleName() + ") / " +
s.getLocalTransform().getTranslation().toString() + ", " +
s.getLocalTransform().getRotation().toString() + ", " +
s.getLocalTransform().getScale().toString());
if (s instanceof Node) {
Node n = (Node) s;
for (Spatial spatial : n.getChildren()) {
dumpScene(spatial, indent + 1);
}
}
}
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
@Override
protected Matrix4f getTransformMatrix(Geometry g){
// Compute the Local matrix for the geometry
cachedLocalMat.loadIdentity();
cachedLocalMat.setRotationQuaternion(g.localTransform.getRotation());
cachedLocalMat.setTranslation(g.localTransform.getTranslation());
TempVars vars = TempVars.get();
Matrix4f scaleMat = vars.tempMat4;
scaleMat.loadIdentity();
scaleMat.scale(g.localTransform.getScale());
cachedLocalMat.multLocal(scaleMat);
vars.release();
return cachedLocalMat;
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
private boolean insidePlane(Plane p, Vector3f axis1, Vector3f axis2, Vector3f axis3, Vector3f tn) {
// transform the plane normal in the box local space.
tn.set(axis1.dot(p.getNormal()), axis2.dot(p.getNormal()), axis3.dot(p.getNormal()));
// distance check
float radius = FastMath.abs(tn.x) +
FastMath.abs(tn.y) +
FastMath.abs(tn.z);
float distance = p.pseudoDistance(transform.getTranslation());
if (distance < -radius) {
return false;
}
return true;
}
内容来源于网络,如有侵权,请联系作者删除!