本文整理汇总了C++中PxTransform::getNormalized方法的典型用法代码示例。如果您正苦于以下问题:C++ PxTransform::getNormalized方法的具体用法?C++ PxTransform::getNormalized怎么用?C++ PxTransform::getNormalized使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PxTransform
的用法示例。
在下文中一共展示了PxTransform::getNormalized方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setGlobalPose
void NpRigidDynamic::setGlobalPose(const PxTransform& pose, bool autowake)
{
NpScene* scene = NpActor::getAPIScene(*this);
#ifdef PX_CHECKED
if(scene)
scene->checkPositionSanity(*this, pose, "PxRigidDynamic::setGlobalPose");
#endif
PX_CHECK_AND_RETURN(pose.isSane(), "NpRigidDynamic::setGlobalPose: pose is not valid.");
NP_WRITE_CHECK(NpActor::getOwnerScene(*this));
PxTransform p = pose.getNormalized();
if(scene)
{
updateDynamicSceneQueryShapes(mShapeManager, scene->getSceneQueryManagerFast());
}
PxTransform newPose = p;
newPose.q.normalize(); //AM: added to fix 1461 where users read and write orientations for no reason.
Scb::Body& b = getScbBodyFast();
PxTransform body2World = newPose * b.getBody2Actor();
b.setBody2World(body2World, false);
if(scene && autowake && !(b.getActorFlags() & PxActorFlag::eDISABLE_SIMULATION))
wakeUpInternal();
}
示例2: setChildPose
void NpArticulationJoint::setChildPose(const PxTransform& t)
{
PX_CHECK_AND_RETURN(t.isSane(), "NpArticulationJoint::setChildPose t is not valid.");
NP_WRITE_CHECK(getOwnerScene());
mJoint.setChildPose(mChild->getCMassLocalPose().transformInv(t.getNormalized()));
}
示例3: setTargetPose
void NpCloth::setTargetPose(const PxTransform& pose)
{
NP_WRITE_CHECK(NpActor::getOwnerScene(*this));
PX_CHECK_AND_RETURN(pose.isSane(), "PxCloth::setTargetPose: invalid transform!");
mCloth.setTargetPose(pose.getNormalized());
sendPvdSimpleProperties();
}
示例4: setParentPose
void NpArticulationJoint::setParentPose(const PxTransform& t)
{
PX_CHECK_AND_RETURN(t.isSane(), "NpArticulationJoint::setParentPose t is not valid.");
NP_WRITE_CHECK(getOwnerScene());
if(mParent==NULL)
return;
mJoint.setParentPose(mParent->getCMassLocalPose().transformInv(t.getNormalized()));
}
示例5: setCMassLocalPose
void NpArticulationLink::setCMassLocalPose(const PxTransform& pose)
{
NP_WRITE_CHECK(NpActor::getOwnerScene(*this));
PX_CHECK_AND_RETURN(pose.isSane(), "PxArticulationLink::setCMassLocalPose: invalid parameter");
PxTransform p = pose.getNormalized();
PxTransform oldpose = getScbBodyFast().getBody2Actor();
PxTransform comShift = p.transformInv(oldpose);
NpArticulationLinkT::setCMassLocalPoseInternal(p);
if(mInboundJoint)
{
Scb::ArticulationJoint &j = mInboundJoint->getScbArticulationJoint();
j.setChildPose(comShift.transform(j.getChildPose()));
}
for(PxU32 i=0; i<mChildLinks.size(); i++)
{
Scb::ArticulationJoint &j = static_cast<NpArticulationJoint*>(mChildLinks[i]->getInboundJoint())->getScbArticulationJoint();
j.setParentPose(comShift.transform(j.getParentPose()));
}
}
示例6: setCMassLocalPose
void NpRigidDynamic::setCMassLocalPose(const PxTransform& pose)
{
PX_CHECK_AND_RETURN(pose.isSane(), "NpRigidDynamic::setCMassLocalPose pose is not valid.");
NP_WRITE_CHECK(NpActor::getOwnerScene(*this));
PxTransform p = pose.getNormalized();
PxTransform oldBody2Actor = getScbBodyFast().getBody2Actor();
NpRigidDynamicT::setCMassLocalPoseInternal(p);
Scb::Body& b = getScbBodyFast();
if (b.getFlags() & PxRigidBodyFlag::eKINEMATIC)
{
PxTransform bodyTarget;
if (b.getKinematicTarget(bodyTarget))
{
PxTransform actorTarget = bodyTarget * oldBody2Actor.getInverse(); // get old target pose for the actor from the body target
setKinematicTargetInternal(actorTarget);
}
}
}
示例7: setKinematicTarget
void NpRigidDynamic::setKinematicTarget(const PxTransform& destination)
{
PX_CHECK_AND_RETURN(destination.isSane(), "NpRigidDynamic::setKinematicTarget: destination is not valid.");
NpScene* scene = NpActor::getAPIScene(*this);
PX_UNUSED(scene);
NP_WRITE_CHECK(NpActor::getOwnerScene(*this));
#ifdef PX_CHECKED
if(scene)
scene->checkPositionSanity(*this, destination, "PxRigidDynamic::setKinematicTarget");
#endif
Scb::Body& b = getScbBodyFast();
PX_UNUSED(b);
//0) make sure this is kinematic
PX_CHECK_AND_RETURN((b.getFlags() & PxRigidBodyFlag::eKINEMATIC), "RigidDynamic::setKinematicTarget: Body must be kinematic!");
PX_CHECK_AND_RETURN(scene, "RigidDynamic::setKinematicTarget: Body must be in a scene!");
PX_CHECK_AND_RETURN(!(b.getActorFlags() & PxActorFlag::eDISABLE_SIMULATION), "RigidDynamic::setKinematicTarget: Not allowed if PxActorFlag::eDISABLE_SIMULATION is set!");
setKinematicTargetInternal(destination.getNormalized());
}
示例8:
void D6Joint::setDrivePosition(const PxTransform& pose)
{
PX_CHECK_AND_RETURN(pose.isSane(), "PxD6Joint::setDrivePosition: pose invalid");
data().drivePosition = pose.getNormalized();
markDirty();
}