About Store Forum Documentation Contact



Post Reply 
Bit combination (IndexToFlag)
Author Message
Salival Offline
Member

Post: #1
Bit combination (IndexToFlag)
Hey,

Got two questions:

1)

So the group parameter is a bit combination right ? if I only want two types to be checked in a ray test, lets say terrain and entities.

IndexToFlag = convert index to flag

UInt flag = IndexToFlag(Core::Groups::Entity) | IndexToFlag(Core::Groups::Terrain);
Physics.ray(..,...,..., flag)

or think I am completely wrong?, one group works but not two.

2)

Is it possible to apply impulse on ragdolls? Right now I must like apply impulse and enable ragdoll after a time period, lets say 100ms, else impulse gets ignored.

cheers.
(This post was last modified: 04-02-2012 09:53 AM by Salival.)
04-02-2012 09:35 AM
Find all posts by this user Quote this message in a reply
Ogniok Offline
Member

Post: #2
RE: Bit combination (IndexToFlag)
1) Shouldn't you use:

Code:
UInt flag = IndexToFlag(Core::Groups::Entity | Core::Groups::Terrain);

I may be wrong but I think that should work. smile
04-02-2012 02:46 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #3
RE: Bit combination (IndexToFlag)
UInt flag = IndexToFlag(Core::Groups::Entity) | IndexToFlag(Core::Groups::Terrain);
this is ok, remember that only 0..31 groups are supported.
04-05-2012 03:10 AM
Find all posts by this user Quote this message in a reply
Post Reply