Jump to content

Entity pick not accurate


Arska134
 Share

Recommended Posts

I am trying to pick other players. When player joins game i do this:

SetEntityKey( pp.model, "player", pp.nickname)

 

pp.model is:

pp.model = loadmesh("abstract::swat.gmf")

 

So pp.model is mesh and it should be picked?

Windows 7 Ultimate | Intel Core i7 930 @ 2.80 ghz | Nvidia GeForce GTX 560 | Leadwerks 2.5 | Blitzmax

Link to comment
Share on other sites

Have you set the entity type of the mesh and have you set the collisions so that the raycast type and mesh type result in a registered collision?

 

Also if the character is animated the pick will only work on the original mesh of the character and not the resultant skinning deformation you see.

STS - Scarlet Thread Studios

AKA: Engineer Ken

 

Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now!

Link to comment
Share on other sites

It is much better to check hit against some primitives not player mesh . Best practice use capsule . If you want to have check hits against all body parts then you have to make something like ragdoll and bounding box .First make check is there hit on bounding box.Only in the case if there is , then you can check which part of body.

 

One capsule is OK , make it simple.

  • Upvote 1
Link to comment
Share on other sites

It is much better to check hit against some primitives not player mesh . Best practice use capsule . If you want to have check hits against all body parts then you have to make something like ragdoll and bounding box .First make check is there hit on bounding box.Only in the case if there is , then you can check which part of body.

 

One capsule is OK , make it simple.

 

 

Entity Picks only work on mesh / surfaces. How are you going to have a capsule mesh that isn't obscuring the model..... If you hide it the pick won't work.

 

I think you've confused this with body collisions.

STS - Scarlet Thread Studios

AKA: Engineer Ken

 

Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now!

Link to comment
Share on other sites

I guess you are alone with this cause its all about how you lay out the structure ...

 

object_phyBox.png

 

thats loosely implemented (like all releated to weapons) - however, i just load the mesh of a character and a controller which are not parent or child of the model but the loaded phy object is a child of the model and can be picked ... if that pick occurs i wander up and down the parent/child relations to send a hit message to the model (ENTITY_MODEL) which handles the animations etc. for the character mesh.

 

You most likely want to bind collision spheres to "bone" joints and work with pick.filter

(handling every pick like i do is pretty bad).

At the end i will track every character entity because i dont need to know that a pick occurred but which and where a character got hit by raytracing.

 

hth

AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3

zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5

 

adv_banner-april2012_720x150_tex01.png

 

Xxploration FPS in progress ...

Link to comment
Share on other sites

Entity Picks only work on mesh / surfaces. How are you going to have a capsule mesh that isn't obscuring the model..... If you hide it the pick won't work.

 

I think you've confused this with body collisions.

 

Hmm, I have to think about that , but anyway , raycast with mesh that has 3000 or more polygons is not a good idea, especially when you have a lot of enemies in level. I don't know how LE handles that inside, but I am sure that has to be some work around , perhaps (show and hide capsule or something... ) I have to refresh my mind first smile.png . I have to go now , but I will look at this problem when I come back.

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