Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, juanex, Grant), 1,018 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
pXent_addforcecentral ( entity, VECTOR* vForce ); #348390
11/25/10 22:16
11/25/10 22:16
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Happy Birthday Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Kleinigkeit:

Quote:
Wenn Sie die Entity ohne Rücksicht auf die Framerate auf eine bestimmte Geschwindigkeit beschleunigen wollen, nehmen Sie stattdessen he entity to a certain speed regardeless of the frame rate, use pXent_addvelcentral.


EDIT: Im Eintrag zu pXcon_set6djoint befinden sich im Code-Beispiel ein paar Tippfehler (bei pXcon_add ein fehlender Parameter und "swindLimit").
Ich habe es testweise mit einem anderen physX-Beispiel kombiniert, wenn man box4 (SPHERE) anklickt (pX_pick), klappt es wunderbar. Bewege ich box5 (CUBE), spielt das Konstrukt ein wenig verrückt - korrektes Verhalten (also übersehe ich etwas) oder Bug?

Code:
#include <default.c>
#include <ackphysx.h>

function main()
{
  physX_open();
  level_load(""); // load an empty level
  vec_set(camera.x,vector(-100,0,30));
  pXent_settype(NULL,PH_STATIC,PH_PLANE); // create a static plane at groundlevel zero
  
  ENTITY* box4 = ent_create(SPHERE_MDL,vector(0,0,100),NULL);
 ENTITY* box5 = ent_create(CUBE_MDL,vector(0,0,60),NULL);
   pXent_settype(box4,PH_RIGID,PH_SPHERE );
   pXent_settype(box5,PH_RIGID,PH_BOX );

// upper joint
   pXcon_add(PH_6DJOINT,box4,NULL,0); // when you use NULL you attach the entity (box4) to the world 
// lower joint
   pXcon_add(PH_6DJOINT,box5,box4,0);

   VECTOR* globalAxis = vector(0,0,-1); // using the z axis
   pXcon_setparams1(box4,NULL,globalAxis,NULL);
   pXcon_setparams1(box5,NULL,globalAxis,NULL);
 
   VECTOR* swingLimit = vector(30,70,0);
   VECTOR* twistLimit = vector(-90,45,0);
   VECTOR* linearLimit = vector(10,0,0);
   pXcon_setparams2(box4,swingLimit,twistLimit,linearLimit);
   pXcon_setparams2(box5,swingLimit,twistLimit,linearLimit);

   var Motion[6];
   Motion[0] = NX_D6JOINT_MOTION_FREE; // This frees box4 from the world (NULL)
   Motion[1] = NX_D6JOINT_MOTION_FREE;
   Motion[2] = NX_D6JOINT_MOTION_FREE;
   Motion[3] = NX_D6JOINT_MOTION_LIMITED; //this limits the angles
   Motion[4] = NX_D6JOINT_MOTION_LIMITED;
   Motion[5] = NX_D6JOINT_MOTION_LIMITED;
   
   pXcon_set6djoint(box4,Motion,NULL);
   
   Motion[0] = NX_D6JOINT_MOTION_LOCKED; //this locks box5 on box4
   Motion[1] = NX_D6JOINT_MOTION_LOCKED;
   Motion[2] = NX_D6JOINT_MOTION_LOCKED;
   
   pXcon_set6djoint(box5,Motion,NULL);
   
  while(1){
    pX_pick(); // pick and move the ball (!) with the cursor
    wait(1);
  }
}




EDIT2: pXcon_add bringt mein Spiel stets zum Absturz, wenn ich eine Entity mit dem Level verbinden möchte.
Benutzt man obigen Code, so erhalte ich keine Fehlermeldung, ersetze ich aber level_load("") durch bspw. level_load("test.wmb") mit einem Hollow-Cube, so schlägt die Anweisung fehl.
(8.05.1b)

Last edited by Superku; 11/26/10 02:05.

"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: pXent_addforcecentral ( entity, VECTOR* vForce ); [Re: Superku] #348418
11/26/10 14:17
11/26/10 14:17
Joined: Jul 2000
Posts: 27,935
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,935
Frankfurt
Danke, das schauen wir uns an.


Moderated by  aztec, Inestical, Matt_Coles, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1