Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Get collision mesh between 2 vectors  (Read 333 times)
Celledor
Customers
Community Member
*****
Posts: 168


WWW
« on: October 01, 2008, 04:09:08 PM »

Hi,

I need to get the mesh that causes a collision for AdvancedCollision but I can only get it to return a TV_COLLISIONRESULT but I would need a TVCollisionResult.

The COLLISIONRESULT only have iMeshID
but the TVCollisionResult GetCollisionMesh and more.

What I need from the mesh id the .GetUserData and .GetTag cause it is there I have stored some important values.

I will use these values to retrieve four vectors that indicate a buildings four corner to reposition a units given path so that it won't go right trough the building. It will use the corners to make the waypoints the unit use to move around with so that it moves around the building.


I think I got the logic right but I can't get the collision to work.

Logged

Celledor
Customers
Community Member
*****
Posts: 168


WWW
« Reply #1 on: October 02, 2008, 11:41:32 AM »

Found the answer, I could just use the Globals.GetMeshFromID() function.
Logged

Celledor
Customers
Community Member
*****
Posts: 168


WWW
« Reply #2 on: October 06, 2008, 11:22:55 AM »

It works!...

The unit finds a path between the building using the corners no matter how may building there are and it's fast.

There might be those who already have this working and aren’t as excited as I am, but now so do I... well there is one small bug to solve and I need to fix that the unit will not go back (sometimes the closest corner is the one already visited thus adding one unnecessary waypoint) but always forward.

Logged

Raine
Customers
Community Member
*****
Posts: 1189


« Reply #3 on: October 06, 2008, 12:38:33 PM »

I understand your excitement actually. It's cool to come up with solutions and seeing them work. I was wondering, though, have you considered using the pathfinding stuff in TV?
Logged

Celledor
Customers
Community Member
*****
Posts: 168


WWW
« Reply #4 on: October 06, 2008, 01:15:56 PM »

Yes, but this was more fun Wink I'm trying out diffrent things, getting them to work.... I get bored sometimes.
Logged

Raine
Customers
Community Member
*****
Posts: 1189


« Reply #5 on: October 06, 2008, 03:21:49 PM »

That's cool then, looks interesting all the same Smiley
Logged

jviper
Community Member
*
Posts: 1366

Discipline in training


« Reply #6 on: October 06, 2008, 07:48:33 PM »

Plus the path finder in TV3D only works in 2D, doesn't it?
Logged

JAbstract.....Don't just imagine, make it happen!
Celledor
Customers
Community Member
*****
Posts: 168


WWW
« Reply #7 on: October 07, 2008, 01:52:58 AM »

Quote
Plus the path finder in TV3D only works in 2D, doesn't it?

Not sure, this should work in 3D... will try it by making an asteroid field and have a ship fly through it instead of a unit and buildnings on the ground.

In the example bellow I only use four corners in 3D that would be eight but it should work with any number of corners for each object.
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks