![]() |
|
applyTorque bug - Printable Version +- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk) +-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html) +--- Forum: Starfall (https://teamscm.co.uk/forum-7.html) +--- Thread: applyTorque bug (/thread-581.html) |
applyTorque bug - LocInt - 11-11-2014 Hey, For some reason when I touch the SF chip using physgun the SF chip just dissapears / breaks. When I touch it using prop or gravitygun it work just fine. Im using following code Code: V2=Entity:toLocal(quaternion.rotationVector(quaternion.qRotation(Entity:angVelVector())+quaternion.qRotation(Entity:pos())))
Entity:applyTorque((150*V2-13*Entity:pos()*Entity:mass())*Entity:inertia())and yes I have tried with smaller forces. Removing applytorque from the chip fixed the issue but well thats not a solution. RE: applyTorque bug - Person8880 - 11-11-2014 Potential issues: 1. Apply torque is a hack with offset forces because there's no binding to torque in GLua. 2. The physgun applies a constraint to objects it picks up rather than locking their position/angles, so it's possible it spazzes when also under the effect of potentially strong forces thanks to VPhysics brilliant constraints. 3. The rotation vector you're using looks suspect (qRotation(Entity:pos() part in particular), as does the Entity:pos() in the torque (seeing as torque is just a normal to rotate around and its magnitude is the force amount, so Entity:pos() is a pretty strange thing to include) but I'm not awake enough to go over it right now. Likely 3 is the real problem. RE: applyTorque bug - LocInt - 11-11-2014 (11-11-2014, 08:35 PM)Person8880 Wrote: Potential issues: The problem remais even if I remove Entity:pos() part. |