About Store Forum Documentation Contact



Post Reply 
Raycast & grab for MeshBase, not actor question
Author Message
Antony Offline
Member

Post: #1
Raycast & grab for MeshBase, not actor question
Hi,

I'm trying to detect a MeshBase under the mouse cursor to grab and move the MeshBase. I know that I can't use PhysHit, as the object is not an actor, and I've read some threads that got me closer (sweep, Physics.sweep), but I wonder if someone can help me see what I'm doing wrong:

I tried messing around (with limited success) with PosPointMeshY and PosPointMeshZ, using converted Ms.pos().

EDIT: Resolved detection, and in case it helps others, ScreenToPosDir to get start and end vecs, then use if(Sweep(start,end-start,<your mesh base>)) {

I read on other threads that mesh detection with Sweep is slow real time and is not recommended by esenthel. I can confirm that there is a noticeable lag when I move my mouse over a mesh to detect it. Also, I have to iterate all meshes, and I have about thirty, and have that function called on update, so I'm guessing it will be very slow.

Would be great if Esenthel or someone knowledgeable could guide me to go about this in a more efficient way.
(This post was last modified: 02-09-2011 05:35 PM by Antony.)
02-09-2011 05:25 AM
Find all posts by this user Quote this message in a reply
Post Reply