I ran to this weird problem that DarkBASIC is not recognizing command:
NDB_NewtonConvexHullModifierSetMatrix(Col2)
at all, it says "Could not understand command at line x" and when I remove that piece of code the game compiles fine, without the modifier though.
Whole initialization of the player:
load object "Media\Models\Physics\PlCol.x", 31
Col = NDB_NewtonCreateConvexHull(31)
Col2 = NDB_NewtonCreateConvexHullModifier(Col)
Player = NDB_NewtonCreateBody(Col2)
NDB_BuildMatrix 0.0, 0.0, 0.0, 0.0, 250.0, 80.0
NDB_NewtonBodySetMatrix Player
NDB_SetVector 6.0, 8.0, 6.0
NDB_CalculateMIBoxSolid 50
NDB_NewtonBodySetMassMatrix Player, 50
NDB_NewtonBodySetAutoFreeze Player, 0
NDB_BodySetGravity Player, 1
NDB_SetVector 0.0, 1.0, 0.0
UpVector = NDB_NewtonConstraintCreateUpVector( Player )
Default = NDB_NewtonMaterialGetDefaultGroupID()
PlayerID = NDB_NewtonMaterialCreateGroupID()
NDB_NewtonMaterialSetDefaultFriction Default, PlayerID, 0.05, 0.5
NDB_NewtonMaterialSetDefaultElasticity Default, PlayerID, 0.01
NDB_NewtonBodySetMaterialGroupID Player, PlayerID
NDB_BuildScaleMatrix 25.0,25.0,25.0
NDB_NewtonConvexHullModifierSetMatrix(Col2)
As far as I've read the manual that is the only way to make Newton object scalable realtime so that I could make crouching possible.
Is there any other way around this? Change the collision object etc?
(using DB 7.5 beta 11)