def onUpdate(frame, time, dt): global g_closestObject global g_minDistance global g_lastObject global g_previousObject ######################################################################## # ADD THIS TO USE CAVEVOC cavevoc.update() ######################################################################## # The following code creates a head pointer as an intersection ray. # So when you talk about objects like: PAINT IT GREEN, the IT refers to the object # that your head ray is pointing at. # The current selected object gets its bounding box turned on to show that it is selected. camera = getDefaultCamera() camPosition = camera.getPosition() headOffset = camera.getHeadOffset() headPositionWorld = camera.localToWorldPosition(headOffset) g_minDistance = 999999 theray = camera.getOrientation() * camera.getHeadOrientation() * Vector3( 0, 0, -1) g_closestObject = None querySceneRay(headPositionWorld, theray, RayIntersectionCallback) global g_ptrSphere g_ptrSphere.setPosition(headPositionWorld + theray) if g_closestObject != None: if g_previousObject != None: g_previousObject.setBoundingBoxVisible(False) g_lastObject = g_closestObject g_lastObject.setBoundingBoxVisible(True) g_previousObject = g_lastObject
def onUpdate(frame, time, dt): global g_closestObject global g_minDistance global g_lastObject global g_previousObject ######################################################################## # ADD THIS TO USE CAVEVOC cavevoc.update() ######################################################################## # The following code creates a head pointer as an intersection ray. # So when you talk about objects like: PAINT IT GREEN, the IT refers to the object # that your head ray is pointing at. # The current selected object gets its bounding box turned on to show that it is selected. camera = getDefaultCamera() camPosition = camera.getPosition() headOffset = camera.getHeadOffset() headPositionWorld = camera.localToWorldPosition(headOffset) g_minDistance = 999999 theray = camera.getOrientation() * camera.getHeadOrientation() * Vector3(0,0,-1) g_closestObject = None querySceneRay(headPositionWorld, theray, RayIntersectionCallback) global g_ptrSphere g_ptrSphere.setPosition(headPositionWorld+theray) if g_closestObject != None: if g_previousObject != None: g_previousObject.setBoundingBoxVisible(False) g_lastObject = g_closestObject g_lastObject.setBoundingBoxVisible(True) g_previousObject = g_lastObject
def onUpdate(frame, time, dt): ######################################################################## # ADD THIS TO USE CAVEVOC cavevoc.update()