A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by carli2 » Wed Sep 26, 2012 7:49 pm
Hi,
NewtonWorldConvexCast always returns 1.2000005 as param. The function result is always 0.
This was the case in some corner cases for core300. in core301, it is now always the case. What am I doing wrong?
Here's my code: (nothing different from the examples. you have a _ASSERTE (param < 1.0f); in your code, but param always comes above this value
- Code: Select all
function TWorldObject.moveTill(matrix: TMatrix4; pos: TVec3): boolean;
var
force: TVec3;
len: single;
info: array[0..15] of NewtonWorldConvexCastReturnInfo;
param: single;
i: integer; max: single;
begin
len:=sqrt(sqr(pos[0])+sqr(pos[1])+sqr(pos[2]));
if len<0.001 then exit; // Keine Bewegung
force:=ApplyMatrixToVec3(matrix, pos); // Zielposition
param:=0;
i:=length(info);
i:=NewtonWorldConvexCast(NewtonBodyGetWorld(newton), @matrix[0][0], @force[0], NewtonBodyGetCollision(newton), @param, self, @myprefilter, @info[0], i, 0);
max:=1;
if i>0 then begin
max:=param;
result:=true;
end else result:=false;
if max>0 then begin
MatrixSetTransform(matrix, MatrixGetTransform(matrix) * (1-max) + force * max);
NewtonBodySetMatrix(newton, @matrix[0][0]);
end;
end;
-
carli2
-
- Posts: 157
- Joined: Thu Nov 10, 2011 1:53 pm
by Julio Jerez » Thu Sep 27, 2012 12:54 am
yes I have to comnet it for a momenet untill I complete the secund part of the collision system.
I see if I can have back this weekend.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by carli2 » Thu Sep 27, 2012 4:54 am
So the only thing I can do is to wait?
-
carli2
-
- Posts: 157
- Joined: Thu Nov 10, 2011 1:53 pm
by carli2 » Mon Oct 01, 2012 5:20 am
When will NewtonWorldConvexCast work in core300?
Or how can I workaround that?
-
carli2
-
- Posts: 157
- Joined: Thu Nov 10, 2011 1:53 pm
by Julio Jerez » Mon Oct 01, 2012 11:09 am
I think the eassiest is to wait until I put it back. I am working on getting the CCD on.
But this is not a simple bug fix, core 300 move away from the legacy contact calculateor dgMinkowskiConv.cpp core 200
to a more streamlined contact calculator implement as a method of the common convex shape.
This takes advantage of the shape definition and to be faster, but I has not done all function yet.
It will be in sometime this week.
what are you using convex cast for?
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by carli2 » Tue Oct 02, 2012 2:34 am
Julio Jerez wrote:what are you using convex cast for?
For nearly everything: Character controller, object placement...
When I run gwX with ConvexCast returning 0 with param 1.20000005, all spawned objects start under the ground surface - completely unplayable.
I can stay at core200 until newton 3 works correctly.
-
carli2
-
- Posts: 157
- Joined: Thu Nov 10, 2011 1:53 pm
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 3 guests