X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FSkeleton.cpp;h=5b28f738f4ac8cfcea8429e8fb0d8d5366e27271;hb=0b7253f3d99e4382008aff8b8e221e88ff40d3e9;hp=ff195387e5227d044a6df8a193e92beab28c5389;hpb=1aef858f5ecb3dc8fd816e0155635371ed3632f2;p=lugaru.git diff --git a/Source/Skeleton.cpp b/Source/Skeleton.cpp index ff19538..5b28f73 100644 --- a/Source/Skeleton.cpp +++ b/Source/Skeleton.cpp @@ -31,7 +31,6 @@ extern Skeleton testskeleton; extern Terrain terrain; extern Objects objects; extern int environment; -extern float terraindetail; extern float camerashake; extern bool freeze; extern int detail; @@ -52,6 +51,8 @@ void dealloc2(void* param){ param=0; } +enum {boneconnect, constraint, muscle}; + void Muscle::DoConstraint(bool spinny) { static XYZ vel; @@ -192,8 +193,8 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale) if(free){ freetime+=multiplier; - whichpatchx=coords->x/(terrain.size/subdivision*terrain.scale*terraindetail); - whichpatchz=coords->z/(terrain.size/subdivision*terrain.scale*terraindetail); + whichpatchx=coords->x/(terrain.size/subdivision*terrain.scale); + whichpatchz=coords->z/(terrain.size/subdivision*terrain.scale); terrainlight=*coords; objects.SphereCheckPossible(&terrainlight, 1); @@ -712,6 +713,7 @@ void Skeleton::SetJoint(float x, float y, float z, int which, int whichjoint) void Skeleton::AddMuscle(int attach1,int attach2,float minlength,float maxlength,int type) { + const int max_muscles = 100; // FIXME: Probably can be dropped if(num_muscles=0&&attach2=0&&attach1!=attach2){ muscles[num_muscles].parent1=&joints[attach1]; muscles[num_muscles].parent2=&joints[attach2];