Пример #1
0
PxArticulationDriveCache* NpArticulation::createDriveCache(PxReal compliance, PxU32 driveIterations) const
{
	PX_CHECK_AND_RETURN_NULL(getAPIScene(), "PxArticulation::createDriveCache: object must be in a scene");
	NP_READ_CHECK(getOwnerScene());	// doesn't modify the scene, only reads

	return reinterpret_cast<PxArticulationDriveCache*>(mArticulation.getScArticulation().createDriveCache(compliance, driveIterations));
}
Пример #2
0
void NpArticulation::releaseDriveCache(PxArticulationDriveCache&cache ) const
{
	PX_CHECK_AND_RETURN(getAPIScene(), "PxArticulation::releaseDriveCache: object must be in a scene");
	NP_READ_CHECK(getOwnerScene());	// doesn't modify the scene, only reads

	mArticulation.getScArticulation().releaseDriveCache(reinterpret_cast<Sc::ArticulationDriveCache&>(cache));
}
Пример #3
0
bool NpArticulation::isSleeping() const
{
	NP_READ_CHECK(getOwnerScene());
	PX_CHECK_AND_RETURN_VAL(getAPIScene(), "Articulation::isSleeping: articulation must be in a scene.", true);

	return getArticulation().isSleeping();
}
Пример #4
0
void NpArticulation::getSolverIterationCounts(PxU32 & positionIters, PxU32 & velocityIters) const
{
	NP_READ_CHECK(getOwnerScene());
	PxU16 x = getArticulation().getSolverIterationCounts();
	velocityIters = PxU32(x >> 8);
	positionIters = PxU32(x & 0xff);
}
Пример #5
0
void NpArticulation::updateDriveCache(PxArticulationDriveCache& cache, PxReal compliance, PxU32 driveIterations) const
{
	PX_CHECK_AND_RETURN(getAPIScene(), "PxArticulation::updateDriveCache: object must be in a scene");

	Sc::ArticulationDriveCache& c = reinterpret_cast<Sc::ArticulationDriveCache&>(cache);
	PX_CHECK_AND_RETURN(mArticulation.getScArticulation().getCacheLinkCount(c) == mArticulationLinks.size(), "PxArticulation::updateDriveCache: Articulation size has changed; drive cache is invalid");

	NP_READ_CHECK(getOwnerScene());	// doesn't modify the scene, only reads
	mArticulation.getScArticulation().updateDriveCache(c, compliance, driveIterations);
}
Пример #6
0
PxU32 NpArticulation::getLinks(PxArticulationLink** buffer, PxU32 bufferSize) const
{
	NP_READ_CHECK(getOwnerScene());
	const PxU32 size = mArticulationLinks.size();

	const PxU32 writeCount = PxMin(size, bufferSize);
	for(PxU32 i=0; i<writeCount; i++)
		buffer[i] = mArticulationLinks[i];

	return writeCount;
//	return Ps::dumpPointerArray((const void**)mArticulationLinks.begin(), mArticulationLinks.size(), (void**)buffer, bufferSize);
}
Пример #7
0
PxBounds3 NpArticulation::getWorldBounds(float inflation) const
{
	NP_READ_CHECK(getOwnerScene());
	PxBounds3 bounds = PxBounds3::empty();

	for(PxU32 i=0; i < mArticulationLinks.size(); i++)
	{
		bounds.include(mArticulationLinks[i]->getWorldBounds());
	}
	PX_ASSERT(bounds.isValid());

	// PT: unfortunately we can't just scale the min/max vectors, we need to go through center/extents.
	const PxVec3 center = bounds.getCenter();
	const PxVec3 inflatedExtents = bounds.getExtents() * inflation;
	return PxBounds3::centerExtents(center, inflatedExtents);
}
Пример #8
0
void NpArticulation::computeImpulseResponse(PxArticulationLink* link,
											PxVec3& linearResponse, 
											PxVec3& angularResponse,
											const PxArticulationDriveCache& driveCache,
											const PxVec3& force,
											const PxVec3& torque) const
{

	PX_CHECK_AND_RETURN(getAPIScene(), "PxArticulation::computeImpulseResponse: object must be in a scene");
	PX_CHECK_AND_RETURN(force.isFinite() && torque.isFinite(), "PxArticulation::computeImpulseResponse: invalid force/torque");
	NP_READ_CHECK(getOwnerScene());

	const Sc::ArticulationDriveCache& c = reinterpret_cast<const  Sc::ArticulationDriveCache&>(driveCache);
	PX_CHECK_AND_RETURN(mArticulation.getScArticulation().getCacheLinkCount(c) == mArticulationLinks.size(), "PxArticulation::computeImpulseResponse: Articulation size has changed; drive cache is invalid");
	PX_UNUSED(&c);

	mArticulation.getScArticulation().computeImpulseResponse(static_cast<NpArticulationLink*>(link)->getScbBodyFast().getScBody(),
															 linearResponse, angularResponse,
															 reinterpret_cast<const Sc::ArticulationDriveCache&>(driveCache),
															 force, torque);
}
Пример #9
0
const char* NpArticulation::getName() const
{
	NP_READ_CHECK(getOwnerScene());
	return mName;
}
PxReal NpArticulationJoint::getExternalCompliance() const
{
	NP_READ_CHECK(getOwnerScene());

	return mJoint.getExternalCompliance();
}
Пример #11
0
PxAggregate* NpArticulation::getAggregate() const
{
	NP_READ_CHECK(getOwnerScene());
	return mAggregate;
}
Пример #12
0
PxU32 NpArticulation::getNbLinks() const
{
	NP_READ_CHECK(getOwnerScene());
	return mArticulationLinks.size();
}
void NpArticulationJoint::getSwingLimit(PxReal &yLimit, PxReal &zLimit) const
{
	NP_READ_CHECK(getOwnerScene());

	mJoint.getSwingLimit(yLimit, zLimit);
}
PxVec3 NpArticulationJoint::getTargetVelocity() const
{
	NP_READ_CHECK(getOwnerScene());

	return mJoint.getTargetVelocity();
}
bool NpArticulationJoint::getTwistLimitEnabled() const
{
	NP_READ_CHECK(getOwnerScene());

	return mJoint.getTwistLimitEnabled();
}
PxReal NpArticulationJoint::getTangentialDamping() const
{
	NP_READ_CHECK(getOwnerScene());

	return mJoint.getTangentialDamping();
}
Пример #17
0
PxReal NpArticulation::getSleepThreshold() const
{
	NP_READ_CHECK(getOwnerScene());
	return getArticulation().getSleepThreshold();
}
Пример #18
0
PxReal NpArticulation::getSeparationTolerance() const
{
	NP_READ_CHECK(getOwnerScene());
	return getArticulation().getSeparationTolerance();
}
PxArticulationJointDriveType::Enum	NpArticulationJoint::getDriveType() const
{
	NP_READ_CHECK(getOwnerScene());
	return mJoint.getDriveType();
}
Пример #20
0
PxU32 NpArticulation::getMaxProjectionIterations() const
{
	NP_READ_CHECK(getOwnerScene());
	return getArticulation().getMaxProjectionIterations();
}
Пример #21
0
PxU32 NpArticulation::getExternalDriveIterations() const
{
	NP_READ_CHECK(getOwnerScene());
	return getArticulation().getExternalDriveIterations();
}
PxTransform NpArticulationJoint::getParentPose() const
{
	NP_READ_CHECK(getOwnerScene());

	return mParent->getCMassLocalPose().transform(mJoint.getParentPose());
}
PxReal NpArticulationJoint::getTwistLimitContactDistance() const
{
	NP_READ_CHECK(getOwnerScene());

	return mJoint.getTwistLimitContactDistance();
}
Пример #24
0
PxReal NpArticulation::getStabilizationThreshold() const
{
	NP_READ_CHECK(getOwnerScene());
	return getArticulation().getFreezeThreshold();
}
PxReal NpArticulationJoint::getStiffness() const
{
	NP_READ_CHECK(getOwnerScene());

	return mJoint.getStiffness();
}
Пример #26
0
PxReal NpArticulation::getWakeCounter() const
{
	NP_READ_CHECK(getOwnerScene());
	return getArticulation().getWakeCounter();
}
PxQuat NpArticulationJoint::getTargetOrientation() const
{
	NP_READ_CHECK(getOwnerScene());

	return mJoint.getTargetOrientation();
}
void NpArticulationJoint::getTwistLimit(PxReal &lower, PxReal &upper) const
{
	NP_READ_CHECK(getOwnerScene());

	mJoint.getTwistLimit(lower, upper);
}