how to get parameterID

Typically: "How do I... ", "How can I... " questions
Post Reply
furious
Posts: 4
Joined: 17 Mar 2017, 09:37

how to get parameterID

Post by furious » 28 May 2017, 21:44

Hello,

i'm trying to modify a proximity sensor (range) on the fly.
i tried to use :

Code: Select all

simGetObjectFloatParameter(simGetObjectHandle('sensConv1'),floatParams[1],10)
my parameters look like this

Code: Select all

 local floatParams = {
	0.0, --lc.near_, -- offset (volume description)
	1, --lc.far_-lc.near_, -- range (volume description)
        0.3,--*lc.near_*tan(lc.horizontalFOV/2), -- x size (volume description)
        0.03,--*lc.near_*tan(lc.horizontalFOV/2), -- y size (volume description)
        0.3,--*lc.far_*tan(lc.horizontalFOV*lc.aspectRatio/2), -- x size far (volume description)
        0.03,--*lc.far_*tan(lc.horizontalFOV*lc.aspectRatio/2), -- y size far (volume description)
        0, -- inside gap (volume description)
        0, -- radius (volume description)
        0, -- radius far (volume description)
        0, -- angle (volume description)
        0, -- threshold angle for limited angle detection (see bit 6 above)
        0, -- smallest detection distance (see bit 8 above)
        0, -- sensing point size
        0, -- reserved. Set to 0.0
        0  -- reserved. Set to 0.0
		  };
how do i change

Code: Select all

1, --lc.far_-lc.near_, -- range (volume description)
on the fly?

i get this error :

Code: Select all

Lua runtime error: attempt to index global 'floatParams' (a nil value)

thanks in advance!
Furious

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

Re: how to get parameterID

Post by coppelia » 29 May 2017, 13:05

Hello,

are you trying to use simCreateProximitySensor?
You cannot modify individual parameters. You will have to create a new proximity sensor on the fly (and auxiliary maybe destroy the old proximity sensor).

Cheers

Post Reply