Chiblue Posted March 17, 2010 Share Posted March 17, 2010 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... Quote If it's not Tactical realism then you are just playing.. Link to comment Share on other sites More sharing options...
Chris Paulson Posted March 17, 2010 Share Posted March 17, 2010 You might be getting called for each surface of the model the ray goes through. Quote Link to comment Share on other sites More sharing options...
Chiblue Posted March 17, 2010 Author Share Posted March 17, 2010 Is it possible that the model is not a single entity? And it is the child entities that are returning the collision, I will have to check this thanks Quote If it's not Tactical realism then you are just playing.. Link to comment Share on other sites More sharing options...
Recommended Posts
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.