you have spent a good holiday? ... I'm not much ... I returned, just now, to work on NGD, I have implemented the use of treemesh. in this demo coiaxis light, shadow and environment maps are disabled ... What do you think?
- I noticed that some shots of 'bullet' (wheel scooter) pass through some walls, what would it be due? - Delphi has suggested me to use treemesh, instead of the heightmap, what is different?
please! can anyone help me? I'm using the standard joint to build a vehicle, I finally managed to end the suspension (and since I can not use fully your SDK samples, it was very hard work and heavy!). Now I find myself with the problem of having to apply power to the wheels, I'm trying 'addtorque', but the matrix is not multiplied by this function automatically (as in rotate function of OpenGL, for example) ... Does anyone know an algorithm to recommend to ensure that any direction takes the vehicle, the wheels maintain a regular rotation on the HINGE axis? tnk!
(Hopefully I have understood your question ...) if I push the vehicle towards one direction, of course, the wheels rotate on the right axis of the hinge. I served the opposite: turn the wheels to propel the vehicle (as happens in reality). when the vehicolo is oriented on X, the wheels will rotate on Z, then:
NewtonBodyAddTorque ObjVeicolo.Tires (0), vec (0.0, TorqueValue.) V (0) NewtonBodyAddTorque ObjVeicolo.Tires (1), vec (0.0, TorqueValue.) V (0)
This simple formula is not appropriate, since, when the vehicle will be directed to Z, the wheels should rotate on X, then:
NewtonBodyAddTorque ObjVeicolo.Tires (0), vec (TorqueValue.0, 0). V (0) NewtonBodyAddTorque ObjVeicolo.Tires (1), vec (TorqueValue, 0.0). V (0)
I ask an algorithm that allowed me to maintain a fixed rotation (when I apply the torque) axis of HingeJoint, regardless of the direction of the vehicle. however I have solved this way:
'Revenue direction of the vehicle NewtonBodyGetMatrix ObjVeicolo.NBody, MmATRIX.m (0) 'Are the rotational force, the X * matrix multiply (10) 'Are the rotational force on Z * by multiplying array (2) NewtonBodyAddTorque ObjVeicolo.Ruote (0), vec3 (TorqueF MmATRIX.m * (10), 0, TorqueF MmATRIX.m * (2)). Xyz (0) NewtonBodyAddTorque ObjVeicolo.Ruote (1), vec3 (TorqueF MmATRIX.m * (10), 0, TorqueF MmATRIX.m * (2)). Xyz (0)
(I have yet to implement the Y axis ..) this works! However, the wheels slip on the ground and the vehicle is moving slowly (watch this) . http://www.youtube.com/watch?v=5Sgad-ujmG4 I set the frictions and the materials for them, the wheels have the forceandtorquecallback ... Why is it happening?
Err.. it's friction? it's simple friction with variable amout of friction depending on direction of contact. That's what a tire does - it rolls along longtitude and sticks on lateral axis, and this is what you are simulating to make it work like a tire.
Delfi wrote:Err.. it's friction? it's simple friction with variable amout of friction depending on direction of contact. That's what a tire does - it rolls along longtitude and sticks on lateral axis, and this is what you are simulating to make it work like a tire.
Certainly (as in video) wheels rotate on a longitudinal axis, I miss the grip on lateral... So how do I do this? what are functions i need to use? tnk!