Exemplo n.º 1
0
/*
================
rvPhysics_Particle::EvaluateContacts
================
*/
bool rvPhysics_Particle::EvaluateContacts( void ) {
	ClearContacts();
	AddGroundContacts( clipModel );

	AddContactEntitiesForContacts();

	return ( contacts.Num() != 0 );
}
Exemplo n.º 2
0
/*
================
idPhysics_Actor::EvaluateContacts
================
*/
bool idPhysics_Actor::EvaluateContacts( CLIP_DEBUG_PARMS_DECLARATION_ONLY ) {
	// get all the ground contacts
	ClearContacts();
	AddGroundContacts( CLIP_DEBUG_PARMS_PASSTHRU clipModel );
	AddContactEntitiesForContacts();

	return ( contacts.Num() != 0 );
}
Exemplo n.º 3
0
/*
================
idPhysics_Actor::EvaluateContacts
================
*/
bool idPhysics_Actor::EvaluateContacts( void ) {

	// get all the ground contacts
	ClearContacts();
	AddGroundContacts( clipModel );
	AddContactEntitiesForContacts();

	return ( contacts.Num() != 0 );
}
Exemplo n.º 4
0
/*
================
idPhysics_RigidBody::EvaluateContacts
================
*/
bool idPhysics_RigidBody::EvaluateContacts( void ) {
	idVec6 dir;
	int num;
	ClearContacts();
	contacts.SetNum( 10, false );
	dir.SubVec3( 0 ) = current.i.linearMomentum + current.lastTimeStep * gravityVector * mass;
	dir.SubVec3( 1 ) = current.i.angularMomentum;
	dir.SubVec3( 0 ).Normalize();
	dir.SubVec3( 1 ).Normalize();
	num = gameLocal.clip.Contacts( &contacts[0], 10, clipModel->GetOrigin(),
								   dir, CONTACT_EPSILON, clipModel, clipModel->GetAxis(), clipMask, self );
	contacts.SetNum( num, false );
	AddContactEntitiesForContacts();
	return ( contacts.Num() != 0 );
}
/*
================
hhPhysics_StaticForceField::EvaluateContacts
================
*/
bool hhPhysics_StaticForceField::EvaluateContacts( void ) {
	idVec6 dir;
	int num;

	ClearContacts();

	contacts.SetNum( 10, false );

	dir.SubVec3(0).Zero();
	dir.SubVec3(1).Zero();
	//dir.SubVec3(0).Normalize();
	//dir.SubVec3(1).Normalize();
	num = gameLocal.clip.Contacts( &contacts[0], 10, clipModel->GetOrigin(),
					dir, CONTACT_EPSILON, clipModel, clipModel->GetAxis(), MASK_SOLID, self );
	contacts.SetNum( num, false );

	AddContactEntitiesForContacts();

	return ( contacts.Num() != 0 );
}