b1s
Member
|
physcallback
I created a trigger that follows a character.
I was wondering what is the best way to do this?
I created it by using sweep() function and physHit
I tried using cuts(). but I did not understand how to get the other colliding object. Any help out there?
|
|
04-14-2010 06:44 PM |
|
Esenthel
Administrator
|
RE: physcallback
What are you trying to achieve?
Do you want to check what physical actors are located withing a specified shape?
You can call Physics.cuts, provide a callback in which you can check each reported hit separately.
I think there are somewhere tutorials on physics callbacks (bloody massacre perhaps).
|
|
04-14-2010 11:36 PM |
|
b1s
Member
|
RE: physcallback
hmm.. bloody massacre was for licensed only?
i guess i can check that later on..
Yeah I'm looking for a moving trigger system.
Currently i have something like this:
Code:
void EnemyManager::Trigger()
{
ball.set(1.5f,2.0f,1.5f,Vec(pos()+matrix().y*0.8f));
PhysHit phys_hit;
if (bool collision=Physics.sweep(ball,Vec(pos()+matrix().y),&phys_hit))
{
if (state==WALKING)OpenDoors(phys_hit); // Checks if there are any doors in hes path. check if they should be opened.
if (enemyScript!=NULL)enemyScript->CheckObjects(phys_hit); // Checks if there are any other objects //behaviors for them are in the script
}
}
this is not working very well.. i would like to try achieving something similar with cuts?
|
|
04-15-2010 02:17 PM |
|
Esenthel
Administrator
|
RE: physcallback
bloody massacre is available for everyone
|
|
04-15-2010 02:36 PM |
|