Detecting collision with on-the-fly object
I have generated on-the-fly cylinders using vizshape.addCylinder(). I would like to detect collisions with a specific cylinder.
I am able to detect collisions with objects using viz.callback(viz.COLLISION_EVENT,onCollision). I can get the name of the object collided with by using the following code: Code:
def onCollision(info): How do I name on-the-fly objects, and how do I then get the name of the object when a collision occurs? |
You can check to see if info.object matches the name assigned to the cylinder:
Code:
import viz |
Thanks very much. It looks like what I hadn't appreciated is that it is not possible to explicitly name objects (with a string), but instead I needed to follow the handle to the object.
Got it all working now :) |
All times are GMT -7. The time now is 10:32 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC