I asked for this in the general forum, and I'll give it another shot here:
Is it possible to create a CompoundCollision tutorial into the tutorial library, using the current tutorial framework (i.e. using Entity class)? Please?
Misho
Moderators: Sascha Willems, walaber

function CreateCompoundCollision : PNewtonBody;
var
X : Integer;
Collisions : Array [0..5] of PNewtonCollision;
Compound : PNewtonCollision;
begin
//Setup 6 Collisions
for X := 0 to 5 do
Collisions[X] := NewtonCreateBox(World,1,1,1,0,Nil);
//Create Compound
Compound := NewtonCreateCompoundCollision(World,6,@Collisions[0],0);
//Create Body
Result := NewtonCreateBody(World,Compound);
//Release Collisions
for X := 0 to 5 do
NewtonReleaseCollision(World,Collisions[X]);
NewtonReleaseCollision(World,Compound);
end;
TSubObject = Class(TObject)
public
function BuildCollision : PNewtonCollision; Virtual;
procedure Draw; Virtual;
end;
TCube = Class(TSubObject)
public
constructor Create(X,Y,Z : Single; SizeX,SizeY,SizeZ : Single);
function BuildCollision : PNewtonCollision; override;
procedure Draw; override;
end;
TSphere = ...
TEntity = Class(TObject)
private
FBody : PNewtonCollision;
FSubObject : Array of TSubObject;
public
procedure AddSubObject(SubObject : TSubObject);
procedure Draw; //Calls all sub classes Draw
procedure BuildCollisions; //Calls all sub classes BuildCollision and creates a compound collision if there is more than one
end;#include "Entity.h"
#include "dBaseHierarchy.h"
class MyModel: public dHierarchy <Entity>
{
// add whate vet you wnat here.
NewtonBody* my physic
...
}
Stucuk wrote:As there in 2009 not 2010, they weren't designed to be compiled with 2010. Don't quote me, but i think 2010 changes some stuff (Compiler wise) so not everything created with previous versions will compile without changes made to them.


Julio Jerez wrote:Ok the wiki tutorial are converted to to Vs 2008, I do not remember if it was you who asked, but for they they are.
for now on the lowest version of Visual studio is VS 2008,
it should be very simple to import the project into VS 2010, I will not not that because I do not have time to spend now.
Note:
The Raycast is not working when I did the coneversion, this may be because of the stuff I am working now, but I cannot debug at this time.
or it could also be beacuse of what was said about sleeping bodies no weaking up after they go to sleep. I have to find out what it is as soon as I have the demos running.
Users browsing this forum: No registered users and 143 guests