Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » check if 2 objects are in eachother
Re: check if 2 objects are in eachother [message #468593 is a reply to message #468148] Fri, 08 June 2012 02:12 Go to previous messageGo to previous message
Whitedragon is currently offline  Whitedragon
Messages: 832
Registered: February 2003
Location: California
Karma:
Colonel
Yes, you can check for collisions like this:

bool Check_Collisions(PhysicalGameObj *obj,const Vector3 &Position) {
	if (!obj) {
		return false;
	}
	MoveablePhysClass *Phys = obj->Peek_Physical_Object()->As_MoveablePhysClass();
	if (!Phys || (!Phys->As_RigidBodyClass() && !Phys->As_Phys3Class())) {
		return false;
	}
	Matrix3D Transform = Phys->Get_Transform();
	Transform.Set_Translation(Position);
	return Phys->Can_Teleport(Transform);
}


This will work for characters and moveable vehicles. Won't work on static objects, turrets, etc.


Black-Cell.net
Network Administrator (2003 - )

DragonServ, Renegade's first IRC interface bot
Creator and lead coder (2002 - )

Dragonade, Renegade's first server side modification
Lead coder (2005 - )
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Tiberian Technologies Special Collisions
Next Topic: Proper lightmapping in renegade will soon be possible
Goto Forum:
  


Current Time: Sun Jul 20 11:09:59 MST 2025

Total time taken to generate the page: 0.00642 seconds