]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - collision.c
add cvars for world erp and cfm; remove pistons for ODE 0.9 support
[xonotic/darkplaces.git] / collision.c
index 192e7729c77b6556cbe870ebff443084e2aed006..4411e8979f8f276911f5b6181e371ebab4d59230 100644 (file)
@@ -1537,7 +1537,6 @@ void Collision_ClipToGenericEntity(trace_t *trace, dp_model_t *model, int frame,
 
        memset(trace, 0, sizeof(*trace));
        trace->fraction = trace->realfraction = 1;
-       VectorCopy(end, trace->endpos);
 
        Matrix4x4_Transform(inversematrix, start, starttransformed);
        Matrix4x4_Transform(inversematrix, end, endtransformed);
@@ -1575,7 +1574,6 @@ void Collision_ClipLineToGenericEntity(trace_t *trace, dp_model_t *model, int fr
 
        memset(trace, 0, sizeof(*trace));
        trace->fraction = trace->realfraction = 1;
-       VectorCopy(end, trace->endpos);
 
        Matrix4x4_Transform(inversematrix, start, starttransformed);
        Matrix4x4_Transform(inversematrix, end, endtransformed);
@@ -1613,7 +1611,6 @@ void Collision_ClipPointToGenericEntity(trace_t *trace, dp_model_t *model, int f
 
        memset(trace, 0, sizeof(*trace));
        trace->fraction = trace->realfraction = 1;
-       VectorCopy(start, trace->endpos);
 
        Matrix4x4_Transform(inversematrix, start, starttransformed);
 #if COLLISIONPARANOID >= 3
@@ -1625,6 +1622,7 @@ void Collision_ClipPointToGenericEntity(trace_t *trace, dp_model_t *model, int f
        else
                Collision_ClipTrace_Point(trace, bodymins, bodymaxs, starttransformed, hitsupercontentsmask, bodysupercontents, 0, NULL);
 
+       VectorCopy(start, trace->endpos);
        // transform plane
        // NOTE: this relies on plane.dist being directly after plane.normal
        Matrix4x4_TransformPositivePlane(matrix, trace->plane.normal[0], trace->plane.normal[1], trace->plane.normal[2], trace->plane.dist, trace->plane.normal);
@@ -1634,9 +1632,9 @@ void Collision_ClipPointToWorld(trace_t *trace, dp_model_t *model, const vec3_t
 {
        memset(trace, 0, sizeof(*trace));
        trace->fraction = trace->realfraction = 1;
-       VectorCopy(start, trace->endpos);
        if (model && model->TracePoint)
                model->TracePoint(model, 0, trace, start, hitsupercontents);
+       VectorCopy(start, trace->endpos);
 }
 
 void Collision_CombineTraces(trace_t *cliptrace, const trace_t *trace, void *touch, qboolean isbmodel)