本文整理汇总了Java中com.bulletphysics.dynamics.constraintsolver.Generic6DofConstraint类的典型用法代码示例。如果您正苦于以下问题:Java Generic6DofConstraint类的具体用法?Java Generic6DofConstraint怎么用?Java Generic6DofConstraint使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Generic6DofConstraint类属于com.bulletphysics.dynamics.constraintsolver包,在下文中一共展示了Generic6DofConstraint类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SixDofJoint
import com.bulletphysics.dynamics.constraintsolver.Generic6DofConstraint; //导入依赖的package包/类
/**
* @param pivotA local translation of the joint connection point in node A
* @param pivotB local translation of the joint connection point in node B
*/
public SixDofJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB, Matrix3f rotA, Matrix3f rotB, boolean useLinearReferenceFrameA) {
super(nodeA, nodeB, pivotA, pivotB);
this.useLinearReferenceFrameA = useLinearReferenceFrameA;
Transform transA = new Transform(Converter.convert(rotA));
Converter.convert(pivotA, transA.origin);
Converter.convert(rotA, transA.basis);
Transform transB = new Transform(Converter.convert(rotB));
Converter.convert(pivotB, transB.origin);
Converter.convert(rotB, transB.basis);
constraint = new Generic6DofConstraint(nodeA.getObjectId(), nodeB.getObjectId(), transA, transB, useLinearReferenceFrameA);
gatherMotors();
}
示例2: gatherMotors
import com.bulletphysics.dynamics.constraintsolver.Generic6DofConstraint; //导入依赖的package包/类
private void gatherMotors() {
for (int i = 0; i < 3; i++) {
RotationalLimitMotor rmot = new RotationalLimitMotor(((Generic6DofConstraint) constraint).getRotationalLimitMotor(i));
rotationalMotors.add(rmot);
}
translationalMotor = new TranslationalLimitMotor(((Generic6DofConstraint) constraint).getTranslationalLimitMotor());
}
示例3: read
import com.bulletphysics.dynamics.constraintsolver.Generic6DofConstraint; //导入依赖的package包/类
@Override
public void read(JmeImporter im) throws IOException {
super.read(im);
InputCapsule capsule = im.getCapsule(this);
Transform transA = new Transform(Converter.convert(new Matrix3f()));
Converter.convert(pivotA, transA.origin);
Transform transB = new Transform(Converter.convert(new Matrix3f()));
Converter.convert(pivotB, transB.origin);
constraint = new Generic6DofConstraint(nodeA.getObjectId(), nodeB.getObjectId(), transA, transB, useLinearReferenceFrameA);
gatherMotors();
setAngularUpperLimit((Vector3f) capsule.readSavable("angularUpperLimit", new Vector3f(Vector3f.POSITIVE_INFINITY)));
setAngularLowerLimit((Vector3f) capsule.readSavable("angularLowerLimit", new Vector3f(Vector3f.NEGATIVE_INFINITY)));
setLinearUpperLimit((Vector3f) capsule.readSavable("linearUpperLimit", new Vector3f(Vector3f.POSITIVE_INFINITY)));
setLinearLowerLimit((Vector3f) capsule.readSavable("linearLowerLimit", new Vector3f(Vector3f.NEGATIVE_INFINITY)));
for (int i = 0; i < 3; i++) {
RotationalLimitMotor rotationalLimitMotor = getRotationalLimitMotor(i);
rotationalLimitMotor.setBounce(capsule.readFloat("rotMotor" + i + "_Bounce", 0.0f));
rotationalLimitMotor.setDamping(capsule.readFloat("rotMotor" + i + "_Damping", 1.0f));
rotationalLimitMotor.setERP(capsule.readFloat("rotMotor" + i + "_ERP", 0.5f));
rotationalLimitMotor.setHiLimit(capsule.readFloat("rotMotor" + i + "_HiLimit", Float.POSITIVE_INFINITY));
rotationalLimitMotor.setLimitSoftness(capsule.readFloat("rotMotor" + i + "_LimitSoftness", 0.5f));
rotationalLimitMotor.setLoLimit(capsule.readFloat("rotMotor" + i + "_LoLimit", Float.NEGATIVE_INFINITY));
rotationalLimitMotor.setMaxLimitForce(capsule.readFloat("rotMotor" + i + "_MaxLimitForce", 300.0f));
rotationalLimitMotor.setMaxMotorForce(capsule.readFloat("rotMotor" + i + "_MaxMotorForce", 0.1f));
rotationalLimitMotor.setTargetVelocity(capsule.readFloat("rotMotor" + i + "_TargetVelocity", 0));
rotationalLimitMotor.setEnableMotor(capsule.readBoolean("rotMotor" + i + "_EnableMotor", false));
}
getTranslationalLimitMotor().setAccumulatedImpulse((Vector3f) capsule.readSavable("transMotor_AccumulatedImpulse", Vector3f.ZERO));
getTranslationalLimitMotor().setDamping(capsule.readFloat("transMotor_Damping", 1.0f));
getTranslationalLimitMotor().setLimitSoftness(capsule.readFloat("transMotor_LimitSoftness", 0.7f));
getTranslationalLimitMotor().setLowerLimit((Vector3f) capsule.readSavable("transMotor_LowerLimit", Vector3f.ZERO));
getTranslationalLimitMotor().setRestitution(capsule.readFloat("transMotor_Restitution", 0.5f));
getTranslationalLimitMotor().setUpperLimit((Vector3f) capsule.readSavable("transMotor_UpperLimit", Vector3f.ZERO));
}
示例4: setLinearUpperLimit
import com.bulletphysics.dynamics.constraintsolver.Generic6DofConstraint; //导入依赖的package包/类
public void setLinearUpperLimit(Vector3f vector) {
linearUpperLimit.set(vector);
((Generic6DofConstraint) constraint).setLinearUpperLimit(Converter.convert(vector));
}
示例5: setLinearLowerLimit
import com.bulletphysics.dynamics.constraintsolver.Generic6DofConstraint; //导入依赖的package包/类
public void setLinearLowerLimit(Vector3f vector) {
linearLowerLimit.set(vector);
((Generic6DofConstraint) constraint).setLinearLowerLimit(Converter.convert(vector));
}
示例6: setAngularUpperLimit
import com.bulletphysics.dynamics.constraintsolver.Generic6DofConstraint; //导入依赖的package包/类
public void setAngularUpperLimit(Vector3f vector) {
angularUpperLimit.set(vector);
((Generic6DofConstraint) constraint).setAngularUpperLimit(Converter.convert(vector));
}
示例7: setAngularLowerLimit
import com.bulletphysics.dynamics.constraintsolver.Generic6DofConstraint; //导入依赖的package包/类
public void setAngularLowerLimit(Vector3f vector) {
angularLowerLimit.set(vector);
((Generic6DofConstraint) constraint).setAngularLowerLimit(Converter.convert(vector));
}