本文整理汇总了Java中com.bulletphysics.linearmath.Transform.set方法的典型用法代码示例。如果您正苦于以下问题:Java Transform.set方法的具体用法?Java Transform.set怎么用?Java Transform.set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.bulletphysics.linearmath.Transform
的用法示例。
在下文中一共展示了Transform.set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getChildTransform
import com.bulletphysics.linearmath.Transform; //导入方法依赖的package包/类
public Transform getChildTransform (int index, Transform out) {
out.set(children.getQuick(index).transform);
return out;
}
示例2: getTransformA
import com.bulletphysics.linearmath.Transform; //导入方法依赖的package包/类
public void getTransformA(Transform dest) {
dest.set(transA);
}
示例3: getTransformB
import com.bulletphysics.linearmath.Transform; //导入方法依赖的package包/类
public void getTransformB(Transform dest) {
dest.set(transB);
}
示例4: getWorldTransform
import com.bulletphysics.linearmath.Transform; //导入方法依赖的package包/类
public Transform getWorldTransform(Transform out) {
out.set(worldTransform);
return out;
}
示例5: getInterpolationWorldTransform
import com.bulletphysics.linearmath.Transform; //导入方法依赖的package包/类
public Transform getInterpolationWorldTransform(Transform out) {
out.set(interpolationWorldTransform);
return out;
}
示例6: convexSweepTest
import com.bulletphysics.linearmath.Transform; //导入方法依赖的package包/类
public void convexSweepTest(ConvexShape castShape, Transform convexFromWorld, Transform convexToWorld, CollisionWorld.ConvexResultCallback resultCallback, float allowedCcdPenetration) {
Stack stack = Stack.enter();
Transform convexFromTrans = stack.allocTransform();
Transform convexToTrans = stack.allocTransform();
convexFromTrans.set(convexFromWorld);
convexToTrans.set(convexToWorld);
Vector3 castShapeAabbMin = stack.allocVector3();
Vector3 castShapeAabbMax = stack.allocVector3();
// compute AABB that encompasses angular movement
{
Vector3 linVel = stack.allocVector3();
Vector3 angVel = stack.allocVector3();
TransformUtil.calculateVelocity(convexFromTrans, convexToTrans, 1f, linVel, angVel);
Transform R = stack.allocTransform();
R.setIdentity();
R.setRotation(convexFromTrans.getRotation(stack.allocQuaternion()));
castShape.calculateTemporalAabb(R, linVel, angVel, 1f, castShapeAabbMin, castShapeAabbMax);
}
Transform tmpTrans = stack.allocTransform();
// go over all objects, and if the ray intersects their aabb + cast shape aabb,
// do a ray-shape query using convexCaster (CCD)
for (int i=0; i<overlappingObjects.size(); i++) {
CollisionObject collisionObject = overlappingObjects.getQuick(i);
// only perform raycast if filterMask matches
if (resultCallback.needsCollision(collisionObject.getBroadphaseHandle())) {
//RigidcollisionObject* collisionObject = ctrl->GetRigidcollisionObject();
Vector3 collisionObjectAabbMin = stack.allocVector3();
Vector3 collisionObjectAabbMax = stack.allocVector3();
collisionObject.getCollisionShape().getAabb(collisionObject.getWorldTransform(tmpTrans), collisionObjectAabbMin, collisionObjectAabbMax);
AabbUtil2.aabbExpand(collisionObjectAabbMin, collisionObjectAabbMax, castShapeAabbMin, castShapeAabbMax);
float[] hitLambda = new float[]{1f}; // could use resultCallback.closestHitFraction, but needs testing
Vector3 hitNormal = stack.allocVector3();
if (AabbUtil2.rayAabb(convexFromWorld.origin, convexToWorld.origin, collisionObjectAabbMin, collisionObjectAabbMax, hitLambda, hitNormal)) {
CollisionWorld.objectQuerySingle(castShape, convexFromTrans, convexToTrans,
collisionObject,
collisionObject.getCollisionShape(),
collisionObject.getWorldTransform(tmpTrans),
resultCallback,
allowedCcdPenetration);
}
}
}
stack.leave();
}
示例7: convexSweepTest
import com.bulletphysics.linearmath.Transform; //导入方法依赖的package包/类
/** convexTest performs a swept convex cast on all objects in the {@link CollisionWorld}, and calls the resultCallback This
* allows for several queries: first hit, all hits, any hit, dependent on the value return by the callback. */
public void convexSweepTest (ConvexShape castShape, Transform convexFromWorld, Transform convexToWorld,
ConvexResultCallback resultCallback) {
Stack stack = Stack.enter();
Transform convexFromTrans = stack.allocTransform();
Transform convexToTrans = stack.allocTransform();
convexFromTrans.set(convexFromWorld);
convexToTrans.set(convexToWorld);
Vector3 castShapeAabbMin = stack.allocVector3();
Vector3 castShapeAabbMax = stack.allocVector3();
// Compute AABB that encompasses angular movement
{
Vector3 linVel = stack.allocVector3();
Vector3 angVel = stack.allocVector3();
TransformUtil.calculateVelocity(convexFromTrans, convexToTrans, 1f, linVel, angVel);
Transform R = stack.allocTransform();
R.setIdentity();
R.setRotation(convexFromTrans.getRotation(stack.allocQuaternion()));
castShape.calculateTemporalAabb(R, linVel, angVel, 1f, castShapeAabbMin, castShapeAabbMax);
}
Transform tmpTrans = stack.allocTransform();
Vector3 collisionObjectAabbMin = stack.allocVector3();
Vector3 collisionObjectAabbMax = stack.allocVector3();
float[] hitLambda = new float[1];
// go over all objects, and if the ray intersects their aabb + cast shape aabb,
// do a ray-shape query using convexCaster (CCD)
for (int i = 0; i < collisionObjects.size(); i++) {
CollisionObject collisionObject = collisionObjects.getQuick(i);
// only perform raycast if filterMask matches
if (resultCallback.needsCollision(collisionObject.getBroadphaseHandle())) {
// RigidcollisionObject* collisionObject = ctrl->GetRigidcollisionObject();
collisionObject.getWorldTransform(tmpTrans);
collisionObject.getCollisionShape().getAabb(tmpTrans, collisionObjectAabbMin, collisionObjectAabbMax);
AabbUtil2.aabbExpand(collisionObjectAabbMin, collisionObjectAabbMax, castShapeAabbMin, castShapeAabbMax);
hitLambda[0] = 1f; // could use resultCallback.closestHitFraction, but needs testing
Vector3 hitNormal = stack.allocVector3();
if (AabbUtil2.rayAabb(convexFromWorld.origin, convexToWorld.origin, collisionObjectAabbMin, collisionObjectAabbMax,
hitLambda, hitNormal)) {
objectQuerySingle(castShape, convexFromTrans, convexToTrans, collisionObject, collisionObject.getCollisionShape(),
tmpTrans, resultCallback, getDispatchInfo().allowedCcdPenetration);
}
}
}
stack.leave();
}
示例8: calculateTimeOfImpact
import com.bulletphysics.linearmath.Transform; //导入方法依赖的package包/类
@Override
public float calculateTimeOfImpact(CollisionObject body0, CollisionObject body1, DispatcherInfo dispatchInfo, ManifoldResult resultOut) {
Stack stack = Stack.enter();
CollisionObject colObj = isSwapped ? body1 : body0;
CollisionObject otherObj = isSwapped ? body0 : body1;
assert (colObj.getCollisionShape().isCompound());
CompoundShape compoundShape = (CompoundShape) colObj.getCollisionShape();
// We will use the OptimizedBVH, AABB tree to cull potential child-overlaps
// If both proxies are Compound, we will deal with that directly, by performing sequential/parallel tree traversals
// given Proxy0 and Proxy1, if both have a tree, Tree0 and Tree1, this means:
// determine overlapping nodes of Proxy1 using Proxy0 AABB against Tree1
// then use each overlapping node AABB against Tree0
// and vise versa.
Transform tmpTrans = stack.allocTransform();
Transform orgTrans = stack.allocTransform();
Transform childTrans = stack.allocTransform();
float hitFraction = 1f;
int numChildren = childCollisionAlgorithms.size();
int i;
for (i = 0; i < numChildren; i++) {
// temporarily exchange parent btCollisionShape with childShape, and recurse
CollisionShape childShape = compoundShape.getChildShape(i);
// backup
colObj.getWorldTransform(orgTrans);
compoundShape.getChildTransform(i, childTrans);
//btTransform newChildWorldTrans = orgTrans*childTrans ;
tmpTrans.set(orgTrans);
tmpTrans.mul(childTrans);
colObj.setWorldTransform(tmpTrans);
CollisionShape tmpShape = colObj.getCollisionShape();
colObj.internalSetTemporaryCollisionShape(childShape);
float frac = childCollisionAlgorithms.getQuick(i).calculateTimeOfImpact(colObj, otherObj, dispatchInfo, resultOut);
if (frac < hitFraction) {
hitFraction = frac;
}
// revert back
colObj.internalSetTemporaryCollisionShape(tmpShape);
colObj.setWorldTransform(orgTrans);
}
stack.leave();
return hitFraction;
}
示例9: getCalculatedTransformB
import com.bulletphysics.linearmath.Transform; //导入方法依赖的package包/类
/**
* Gets the global transform of the offset for body B.<p>
* See also: Generic6DofConstraint.getFrameOffsetA, Generic6DofConstraint.getFrameOffsetB, Generic6DofConstraint.calculateAngleInfo.
*/
public Transform getCalculatedTransformB(Transform out) {
out.set(calculatedTransformB);
return out;
}
示例10: getAFrame
import com.bulletphysics.linearmath.Transform; //导入方法依赖的package包/类
public Transform getAFrame(Transform out) {
out.set(rbAFrame);
return out;
}
示例11: getCalculatedTransformA
import com.bulletphysics.linearmath.Transform; //导入方法依赖的package包/类
public Transform getCalculatedTransformA (Transform out) {
out.set(calculatedTransformA);
return out;
}
示例12: convexSweepTest
import com.bulletphysics.linearmath.Transform; //导入方法依赖的package包/类
/**
* convexTest performs a swept convex cast on all objects in the {@link CollisionWorld}, and calls the resultCallback
* This allows for several queries: first hit, all hits, any hit, dependent on the value return by the callback.
*/
public void convexSweepTest(ConvexShape castShape, Transform convexFromWorld, Transform convexToWorld, ConvexResultCallback resultCallback) {
Transform convexFromTrans = Stack.alloc(Transform.class);
Transform convexToTrans = Stack.alloc(Transform.class);
convexFromTrans.set(convexFromWorld);
convexToTrans.set(convexToWorld);
Vector3f castShapeAabbMin = Stack.alloc(Vector3f.class);
Vector3f castShapeAabbMax = Stack.alloc(Vector3f.class);
// Compute AABB that encompasses angular movement
{
Vector3f linVel = Stack.alloc(Vector3f.class);
Vector3f angVel = Stack.alloc(Vector3f.class);
TransformUtil.calculateVelocity(convexFromTrans, convexToTrans, 1f, linVel, angVel);
Transform R = Stack.alloc(Transform.class);
R.setIdentity();
R.setRotation(convexFromTrans.getRotation(Stack.alloc(Quat4f.class)));
castShape.calculateTemporalAabb(R, linVel, angVel, 1f, castShapeAabbMin, castShapeAabbMax);
}
Transform tmpTrans = Stack.alloc(Transform.class);
Vector3f collisionObjectAabbMin = Stack.alloc(Vector3f.class);
Vector3f collisionObjectAabbMax = Stack.alloc(Vector3f.class);
float[] hitLambda = new float[1];
// go over all objects, and if the ray intersects their aabb + cast shape aabb,
// do a ray-shape query using convexCaster (CCD)
for (int i = 0; i < collisionObjects.size(); i++) {
CollisionObject collisionObject = collisionObjects.getQuick(i);
// only perform raycast if filterMask matches
if (resultCallback.needsCollision(collisionObject.getBroadphaseHandle())) {
//RigidcollisionObject* collisionObject = ctrl->GetRigidcollisionObject();
collisionObject.getWorldTransform(tmpTrans);
collisionObject.getCollisionShape().getAabb(tmpTrans, collisionObjectAabbMin, collisionObjectAabbMax);
AabbUtil2.aabbExpand(collisionObjectAabbMin, collisionObjectAabbMax, castShapeAabbMin, castShapeAabbMax);
hitLambda[0] = 1f; // could use resultCallback.closestHitFraction, but needs testing
Vector3f hitNormal = Stack.alloc(Vector3f.class);
if (AabbUtil2.rayAabb(convexFromWorld.origin, convexToWorld.origin, collisionObjectAabbMin, collisionObjectAabbMax, hitLambda, hitNormal)) {
objectQuerySingle(castShape, convexFromTrans, convexToTrans,
collisionObject,
collisionObject.getCollisionShape(),
tmpTrans,
resultCallback,
getDispatchInfo().allowedCcdPenetration);
}
}
}
}
示例13: getFrameOffsetA
import com.bulletphysics.linearmath.Transform; //导入方法依赖的package包/类
public Transform getFrameOffsetA (Transform out) {
out.set(frameInA);
return out;
}
示例14: getWheelTransformWS
import com.bulletphysics.linearmath.Transform; //导入方法依赖的package包/类
public Transform getWheelTransformWS(int wheelIndex, Transform out) {
assert (wheelIndex < getNumWheels());
WheelInfo wheel = wheelInfo.getQuick(wheelIndex);
out.set(wheel.worldTransform);
return out;
}
示例15: getAFrame
import com.bulletphysics.linearmath.Transform; //导入方法依赖的package包/类
public Transform getAFrame (Transform out) {
out.set(rbAFrame);
return out;
}