PhysX icon indicating copy to clipboard operation
PhysX copied to clipboard

What is analog for NxActor::moveGlobalPose() in PhysX SDK 4.1?

Open SNMetamorph opened this issue 3 years ago • 8 comments

I'm porting old physics code from PhysX SDK 2.8.3 to 4.1 version. And I can't find modern analog for method NxActor::moveGlobalPose(). There is no information about it in migrating from 2.x to 3.x guide. Thanks!

SNMetamorph avatar Aug 30 '22 20:08 SNMetamorph

PxRigidDynamic::setKinematicTarget() should do the job.

jcarius-nv avatar Aug 31 '22 08:08 jcarius-nv

Thanks! What about other functions and enums, like: NxActor::setLinearMomentum NxActorFlags::NX_AF_DISABLE_COLLISION

SNMetamorph avatar Sep 01 '22 11:09 SNMetamorph

And what about force fields which are presented in PhysX SDK 2.8?

SNMetamorph avatar Sep 01 '22 15:09 SNMetamorph

PxRigidBody::setForceAndTorque allows for different modes, e.g., applying force, impulse (momentum), and velocity change.

If you don't want a shape to partake in collisions you can set the eSIMULATION_SHAPE of the shape to 0. More advanced collision setup is possible with collision filtering, there's a section about this in the guide.

Force fields have been removed since PhysX 3.0, see release notes "What's New In NVIDIA PhysX 3.0"

jcarius-nv avatar Sep 05 '22 11:09 jcarius-nv

@jcarius-nv thanks! Are there some replacements for force fields, or maybe it can be implemented manually?

SNMetamorph avatar Sep 05 '22 19:09 SNMetamorph

Unfortunately there is no replacement. It just has to be done by the user through addForce & scene queries or triggers etc.

jcarius-nv avatar Sep 06 '22 08:09 jcarius-nv

I'm stuck again with this old functions: NxShape::getGlobalPosition NxShape::getGlobalOrientation What will be replacement in PhysX SDK 4.1 version? Please.

SNMetamorph avatar Sep 27 '22 21:09 SNMetamorph

class PxShapeExt
{
public:
	/**
	\brief Retrieves the world space pose of the shape.

	\param[in] shape The shape for which to get the global pose.
	\param[in] actor The actor to which the shape is attached

	\return Global pose of shape.
	*/
	static PX_INLINE	PxTransform		getGlobalPose(const PxShape& shape, const PxRigidActor& actor)
	{
		return actor.getGlobalPose() * shape.getLocalPose();
	}

PierreTerdiman avatar Sep 28 '22 05:09 PierreTerdiman