Jump to content

Raycast strange problem...


Chiblue
 Share

Recommended Posts

I am getting a strange problem when using raycast... I am using a callback, when I raycast at an object like a wall that is designated as an entity type 2... The raycast call back which does a GetEntityType on the pick entity returns an entity type of 0...

 

Strange thing is... I have one static object to pass through... I get the following hits from the raycast...

 

Player body - expected..

0 - No idea what this is..

0 - ditto

0 - ditto

0 - ditto

0 - ditto

0 - ditto

0 - ditto

0 - ditto

0 - ditto

0 - ditto

0 - ditto

1 = Terrain

 

 

There is 1 wall model between the raycast and the terrain... this has entity type 2 but raycast pick is returning 0.. also I know it is set to 2 becuase the code that sets it when I debug sets it to 2... also it has collision with my player body which is set in the Lua collisions...

 

 

Callback

int _stdcall PickFilter(TEntity pickentity)
{
int EntType = GetEntityType(pickentity);

 

Raycast

int hit = EntityPick(&pickent,gun,weap->maximumrange,0,0,(BP)PickFilter); 

 

 

Setting the entity type, even though this uses a default even setting this default to "2" does not work...

EntityType(e,atoi(GetEntityKey(e,"collisiontype",(str)strStream.str().c_str())));

 

I put a cout stream for each entity hit callbackk and this is what I get...

 

2020000000001

 

20 is my Playerbody... 1 is the terrain... I don't know were 0 is comming from I don't have any 0 entities

 

For what it is worth I hve attached a screen shot... the wall as you can see is straight ahead, but my raycast is returning the terrain on the other side, and why all the 0s this is the only object between the player and the wall...

post-263-12687915743459_thumb.jpg

If it's not Tactical realism then you are just playing..

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