Jump to content

Vr Template - changing Interactivity/disabling contours


photo

Recommended Posts

Hi,

Is it possible to turn off the white outline and controller vibration of a component of the VR template? I have a model of a house where all the walls are one object, and I need to be able to interact with this object ( changing object's material via interesection with the ray of the laser pointer). The problem is, when only I get inside of the house controllers detect intersection with this wall object all the time and I am not able to use other objects (movable, switch) which are there as well. I think that this behaviour is triggered by the VrPlayer component. How can I override it for my component, so that its materials are still changeable and it does simply nothing when my controllers get near to it/interesect with it? 
For material changing I used the method from this post:

https://developer.unigine.com/forum/topic/5126-solved-adding-controller-functionalitychanging-a-material/?tab=comments#comment-26403

Thanks!
 

Link to comment

Hi Piotr,

You can try to disable grabbing for your house object. The simplest way to do so might be to modify the VRPlayer::can_i_grab_it() method to ignore your house, somewhat like this:

int VRPlayer::can_i_grab_it(const NodePtr &node)
{
	// checking if there is a VRInteractable attached to a node
	bool result = (ComponentSystem::get()->getComponent<VRInteractable>(node) != nullptr);
	
	// excluding your house (by name), you can also use an ID of your house-node or whatever
	result = (result && (strcmp(node->getName(),"your_house_object_name") != 0));
  
	return result;
}

Changing material with a laser pointer should work in this case!

Thank you!

Link to comment
×
×
  • Create New...