Hi.
Just implemented a swim function in my engine with this to change the level of gravity depending how you where positionned in the water.
If I set the vector a (0,-1,0), when I create the collisionResponseAnimator, all is ok. Gravity is what I expect.
If I use the same vector (0,-1,0) using this function (setGravity()). I get a gravity effect of about -100 when I expect to have 1.
It's easy to workaround this (set a very low number (/100) fix the problem). But this should be fixed.
IRRlicht 1.4 - setGravity, value multiplied
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Try /1000!
Spot the difference:
vs
They should certainly be made consistent: the question is which one to change based on how many users it will screw over. Pragmatically, it might be less invasive to have setGravity() do a /1000.f, even though in principle I favour taking the /1000.f out of the constructor.
Spot the difference:
Code: Select all
CSceneNodeAnimatorCollisionResponse::CSceneNodeAnimatorCollisionResponse(
ISceneManager* scenemanager,
ITriangleSelector* world, ISceneNode* object,
const core::vector3df& ellipsoidRadius,
const core::vector3df& gravityPerSecond,
const core::vector3df& ellipsoidTranslation,
f32 slidingSpeed)
: Radius(ellipsoidRadius), Gravity(gravityPerSecond / 1000.0f), ...
Code: Select all
void CSceneNodeAnimatorCollisionResponse::setGravity(const core::vector3df& gravity)
{
Gravity = gravity;
}
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
-
- Posts: 107
- Joined: Sat Nov 04, 2006 9:42 pm
Well, I agree with Rogerborg on both accounts. First, that both should be identical. Second, it should not do an arbitrary modification on the value you give it. If I want to divide a number by 1000, I can do this myself, thank you. And that doesn't help finding things in debug later when a number no longer is what you expected it to be.