当前位置: 首页>>代码示例>>C++>>正文


C++ PxTransform::isSane方法代码示例

本文整理汇总了C++中PxTransform::isSane方法的典型用法代码示例。如果您正苦于以下问题:C++ PxTransform::isSane方法的具体用法?C++ PxTransform::isSane怎么用?C++ PxTransform::isSane使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PxTransform的用法示例。


在下文中一共展示了PxTransform::isSane方法的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();
}
开发者ID:colwalder,项目名称:unrealengine,代码行数:29,代码来源:NpRigidDynamic.cpp

示例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()));
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:8,代码来源:NpArticulationJoint.cpp

示例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();
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:9,代码来源:NpCloth.cpp

示例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()));
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:10,代码来源:NpArticulationJoint.cpp

示例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()));
	}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:23,代码来源:NpArticulationLink.cpp

示例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);
        }
    }
}
开发者ID:colwalder,项目名称:unrealengine,代码行数:23,代码来源:NpRigidDynamic.cpp

示例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());
}
开发者ID:colwalder,项目名称:unrealengine,代码行数:23,代码来源:NpRigidDynamic.cpp

示例8:

void D6Joint::setDrivePosition(const PxTransform& pose)
{	
	PX_CHECK_AND_RETURN(pose.isSane(), "PxD6Joint::setDrivePosition: pose invalid");
	data().drivePosition = pose.getNormalized(); 
	markDirty(); 
}
开发者ID:magetron,项目名称:UnrealEngine4-mod,代码行数:6,代码来源:ExtD6Joint.cpp


注:本文中的PxTransform::isSane方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。