Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » check if 2 objects are in eachother
check if 2 objects are in eachother [message #468148] Tue, 29 May 2012 06:02 Go to next message
robbyke is currently offline  robbyke
Messages: 348
Registered: September 2010
Location: Belgium
Karma: 0
Recruit
is it possible to check if an object will get stuck if you move it?


my usage is in a gate i move down


i use a zone to test if the harv is in it but when the harv isnt driving straight trough the gate and leave the zone the gate will just go down and stuck the harv sometimes (because of the size of the harv)




also is it possible to test if people die in a zone?


Owner of kambot TT server

kambot.freeforums.org

[Updated on: Tue, 29 May 2012 06:03]

Report message to a moderator

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 next message
Whitedragon is currently offline  Whitedragon
Messages: 832
Registered: February 2003
Location: California
Karma: 1
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 - )
Re: check if 2 objects are in eachother [message #469190 is a reply to message #468148] Tue, 12 June 2012 21:03 Go to previous messageGo to next message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
Will that check to see if an object is hitting a wall? or trying to go through the ground?

http://img339.imageshack.us/img339/1991/nefobbygenyunoreleasere.jpg
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*
Re: check if 2 objects are in eachother [message #469191 is a reply to message #468148] Tue, 12 June 2012 21:12 Go to previous messageGo to next message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma: 0
General (5 Stars)
Yes, it checks for all potential physical collisions.

http://steamsignature.com/card/1/76561197975867233.png
Re: check if 2 objects are in eachother [message #469438 is a reply to message #469190] Mon, 18 June 2012 08:39 Go to previous message
Jerad2142 is currently offline  Jerad2142
Messages: 3809
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
halo2pac wrote on Tue, 12 June 2012 22:03

Will that check to see if an object is hitting a wall? or trying to go through the ground?


The world box actually has to have a collision mesh that crosses though it in order for it to flag true. So saying this is a collision check is misleading, as it won't flag true if two vehicles run into each other, you'd actually have to create or set the position of one inside the other.


Previous Topic: Tiberian Technologies Special Collisions
Next Topic: Proper lightmapping in renegade will soon be possible
Goto Forum:
  


Current Time: Sat Nov 23 21:17:32 MST 2024

Total time taken to generate the page: 0.00836 seconds