- terrainnormal = DoRotation(objects.model[k].facenormals[whichhit], 0, objects.yaw[k], 0) * -1;
- if (terrainnormal.y > .8)
- freefall = 0;
- bounceness = terrainnormal * findLength(&joints[i].velocity) * (abs(normaldotproduct(joints[i].velocity, terrainnormal)));
- if (findLengthfast(&joints[i].velocity) > findLengthfast(&joints[i].oldvelocity)) {
- bounceness = 0;
- joints[i].velocity = joints[i].oldvelocity;
- }
- if (tutoriallevel != 1 || id == 0)
- if (findLengthfast(&bounceness) > 4000 && breaking) {
- objects.model[k].MakeDecal(breakdecal, DoRotation(temp - objects.position[k], 0, -objects.yaw[k], 0), .4, .5, Random() % 360);
- Sprite::MakeSprite(cloudsprite, joints[i].position * (*scale) + *coords, joints[i].velocity * .06, 1, 1, 1, 4, .2);
- breaking = false;
- camerashake += .6;
-
- emit_sound_at(breaksound2, joints[i].position * (*scale) + *coords);
-
- addEnvSound(*coords, 64);
- }
- if (objects.type[k] == treetrunktype) {
- objects.rotx[k] += joints[i].velocity.x * multiplier * .4;
- objects.roty[k] += joints[i].velocity.z * multiplier * .4;
- objects.rotx[k + 1] += joints[i].velocity.x * multiplier * .4;
- objects.roty[k + 1] += joints[i].velocity.z * multiplier * .4;
+ terrainnormal = DoRotation(Object::objects[k]->model.Triangles[whichhit].facenormal, 0, Object::objects[k]->yaw, 0) * -1;
+ if (terrainnormal.y > .8) {
+ freefall = 0;
+ }
+ bounceness = terrainnormal * findLength(&joints[i].velocity) * (abs(normaldotproduct(joints[i].velocity, terrainnormal)));
+ if (findLengthfast(&joints[i].velocity) > findLengthfast(&joints[i].oldvelocity)) {
+ bounceness = 0;
+ joints[i].velocity = joints[i].oldvelocity;
+ }
+ if (!Tutorial::active || id == 0) {
+ if (findLengthfast(&bounceness) > 4000 && breaking) {
+ Object::objects[k]->model.MakeDecal(breakdecal, DoRotation(temp - Object::objects[k]->position, 0, -Object::objects[k]->yaw, 0), .4, .5, Random() % 360);
+ Sprite::MakeSprite(cloudsprite, joints[i].position * (*scale) + *coords, joints[i].velocity * .06, 1, 1, 1, 4, .2);
+ breaking = false;
+ camerashake += .6;
+
+ emit_sound_at(breaksound2, joints[i].position * (*scale) + *coords);
+
+ addEnvSound(*coords, 64);