jeffpk
June 12, 2007, 2:04am
1
I have a bunch of Spatial Controllers that individually effect position or orientation.
For the moment, lets just talk about the position ones because if I can get one workign I shoudl be able to get the other.
All these controllers are static, in that they have a single key frame. When applied they set the position of the spatial and thats it.
Each controller effects only one Spatial.
All the controllers are attached to a single node thats attached to the root of my geometry tree.
This is the code that sets them up. It does everything but attach them to the tree which is done in a routine that calls this code:
In the case I'm talking about data.length == 1:
SpatialTransformer sptrans = new SpatialTransformer(1);
sptrans.setObject(targetNode,0,-1);
if (data.length==1){ // static
sptrans.setPosition(0,0f,
new Vector3f(data[0][0],data[0][1],data[0][2]));
} else {
for(int i=0; i< timeKeys.length;i++){
sptrans.setPosition(0,timeKeys[i],
new Vector3f(data[i][0],data[i][1],data[i][2]));
}
}
sptrans.interpolateMissing();
return sptrans;
Currently they don't seem to be having any effect at all. What am I missing?
jeffpk
June 15, 2007, 2:18am
2
Okay. i dont get it.
ive been all through the spatial controller test app. Ive stripped it down to where its just like mine. it continues to work, mine doesnt.
I think imgoing to have to write my won controller so i cna debug into it and figure out whats going on
jeffpk
June 15, 2007, 3:43am
4
alright I think its more complex.
I think my geometry is stil off somehow
neakor
June 12, 2007, 3:43am
5
did u call updateGeometricState in ur update method in the main game loop?
jeffpk
June 12, 2007, 3:59am
6
Nope. I'll try that. Thanks!
I dont currently have an update cuas e im using SimpleGame. but I guess I need one?
Endolf
June 12, 2007, 6:38am
8
Looking at TestSpatialTransformer in the JME source, the one thing I can see there that you have not mentioned, that jumps out at me is model bounds on the objects the controllers are attached too. Have you set them up?
Cheers
Endolf
It's not necessary that anything be added to the update/simpleUpdate method since when running inside the controller you're essentially running in the update method already. A call to updateGeometricState and updateRenderState might make a difference though.
Where are you attaching your controllers to nodes?
jeffpk
June 12, 2007, 7:21pm
10
Basically it looks like this…
SimpleGame->modelRoot->myRoot->controllerNode
->modelGeometry.......
As long as the Controller is actually getting called that should be fine.
jeffpk
June 14, 2007, 2:04am
12
Arligth neither of those helped.
I crated a controlelr that jhust reports itself beign called and controllers ARe being called.
Im going to double check that my target is right and then Im a bit stumped.
Are there permissions for nodes in JME liek there are in J3D and do i have to set something to make a node transformable by the controller?
jeffpk
June 14, 2007, 2:18am
13
All seems to be pointing at the right stuff
Im really at a loss here. has anyone actually TESTED spatial transformers where they have only one time key?
jeffpk
June 14, 2007, 2:25am
14
sigh
Thats not it either cause i tried putting the right valeus at 1f and 0,0,0 at 0f and it still did nothing
Endolf
June 14, 2007, 6:24am
15
what locks have you called on the node that is supposed to move?
Endolf
I'm not much help since I have yet to use spatial transformers.
Someone else will respond I'm sure…HEY, SOMEONE ELSE RESPOND!
jeffpk
June 14, 2007, 6:15pm
17
None.
In fact I checked in the debugger and the locks field is 0
jeffpk
June 14, 2007, 6:16pm
18
I thin ktonight Im going to try multiplying my transformation vector by 100 just to see if myabe its a units problem in how im understanding the data…
jeffpk
June 14, 2007, 6:17pm
19
I should mention I geuss that my target isnt the actual geometry but a Node above it.
This is so it can have children, mehs nodes have to be leaves
neakor
June 15, 2007, 3:58am
20
jeffpk said:
alright I think its more complex.
I think my geometry is stil off somehow
whats more complex?
and what do u mean ur geometry is still off? :?