Proximity sensor XYZ orientation

Typically: "How do I... ", "How can I... " questions
Post Reply
krzmi
Posts: 8
Joined: 01 Nov 2014, 19:07

Proximity sensor XYZ orientation

Post by krzmi » 31 Dec 2014, 14:55

I have a problem with proximity sensor XYZ orienation. When I'm adding new sensor its detection volume is directed along Z axis. Is it possible to reorient detection volume along other axis? All options in Edit -> Reorient bounding box menu are disabled. I can't also modify object geometry in Scene Object Properties dialog. Is there any other way?

Eric
Posts: 186
Joined: 11 Feb 2013, 16:39

Re: Proximity sensor XYZ orientation

Post by Eric » 31 Dec 2014, 16:08

why don t you rotate the sensor?

krzmi
Posts: 8
Joined: 01 Nov 2014, 19:07

Re: Proximity sensor XYZ orientation

Post by krzmi » 31 Dec 2014, 18:04

rotating sensor rotates also its own XYZ orienation. Ray is still oriented along its Z axis

coppelia
Site Admin
Posts: 7396
Joined: 14 Dec 2012, 00:25

Re: Proximity sensor XYZ orientation

Post by coppelia » 31 Dec 2014, 20:30

Hello,

you can do following from a child script for instance:

Code: Select all

if (sim_call_type==sim_childscriptcall_sensing) then
	result,distance,detectedPoint=simReadProximitySensor(sensorHandle)
	if result>0 then
		local m=simBuildMatrix({0,0,0},{math.pi,0,0})
		detectedPoint=simMultiplyVector(m,detectedPoint)
	end
end
Cheers

Post Reply