Jump to content

LE2) EntityCollisionCallback question


ghoflvhxj
 Share

Recommended Posts

I use EntityCollisionCallback function to embody falling damage.

Like this.

 

 

void _stdcall EntityCollisionCallback(TEntity entity0, TEntity entity1, byte* position, byte* normal, byte* force, flt speed)
{
...
}
SetEntityCallback(controller,(byte*)EntityCollisionCallback,ENTITYCALLBACK_COLLISION);

 

 

But, "force" and "speed" parameter have only 0.

Not to get 0 What can i do?

Link to comment
Share on other sites

By the way, Did you know why speed parameter have 0?

Not offhand. I just tried LE2's lua object collision function with an oildrum by printing out force and speed values and it seems to work.

Results:

Speed: 1.8775409460068

Force: 0,0,0

Speed: 1.8775409460068

Force: -2.0766906416725e-008,109.9765625,0

...

...

 

What is the entity being used in the callback? Is the character controller 'entity0'? Worse case, you could try manually calculating the speed of the controller whenever it is airbourne. You could also try GetBodyVelocity(), but I cannot remember if it will work on a controller.

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

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...