Jump to content

Physics collision "overlap"


YouGroove
 Share

Recommended Posts

If I can understand what you are describing, thats what a trigger collision response does. You would probably have to setup your own custom collision type(s) then set the response for your collision types.

 

entity1:SetCollisionType(10)

entity2:SetCollisionType(11)

Collision:SetResponse(10, 11, 2)

--where SetResponse() has three options for the 3rd parameter:

0: no response

1: collide

2: trigger

4: trigger <<--- edited: LE3 changed it to this

  • Upvote 2

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Actually in LE3 Trigger collision is super limited as it can only collide with characters

http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/collision-r778

 

 

Collision:SetResponse(10, 11, 2)

 

It seems it's C++ only method ? I don't find it for Lua or am i wrong ?

 

With Lua we would need to be able to define trigger volumes , it is usefull in gameplay in many ways could it be danger zone/spells to only specific characters, trigger event areas etc ...

Actually this is not possible.

Stop toying and make games

Link to comment
Share on other sites

Actually in LE3 Trigger collision is super limited as it can only collide with characters

Which is why I suggested above for you to create your own custom types and set the responses as needed.

 

There is a difference between a trigger collision TYPE and and a trigger collision RESPONSE. That table is showing the default (inherent) types and their responses built-into the engine. The collision names shown on the top row and left column are the built-in collision TYPES. The cells that use the red/green/yellow text are denoting what RESPONSE happens when the two types come into contact.

 

So like I posted above, the engine only has three available responses for when any two physics objects come into contact:

0: no response

1: collide

2: trigger <--actually appears to be 4

 

Actually since LE3, it appears that the value for the trigger response is set to 4 since Josh used the same variable name for trigger type and trigger response instead of numbers. So probably the safest way to setup the response is to use the Collison.* variable names so there is no confusion on what to set the values.

 

So if the built-in collision types and their responses do not fit your needs, then you can create your own custom collision types and set the responses you need (or add new responses to existing types).

for example:

entity1:SetCollisionType(10) --Custom TYPE

entity2:SetCollisionType(11) --Custom TYPE

Collision:SetResponse(10, 11, 2)

Collision:SetResponse(10, 11, Collision.Trigger)

 

List of inherent types:

Collision.Prop = 1

Collision.Scene = 2

Collision.Character = 3

Collision.Trigger = 4

Collision.Debris = 5

Collision.Projectile = 6

Collision.LineOfSight = 7

 

List of possible responses:

Collision.None = 0

Collision.Collide = 1

Collision.Trigger = 4

 

It seems it's C++ only method ? I don't find it for Lua or am i wrong ?

Its been available in lua for a couple of weeks now.

  • Upvote 1

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

You really should stick to using the named constants. Technically, the values of these are allowed to change at any time, without breaking the spec.

  • Upvote 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...