This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unix:!macx:!symbian: LIBS += -L$$PWD/../../Downloads/tokamakp/trunk/tokamaksrc/ -ltokamak | |
INCLUDEPATH += $$PWD/../../Downloads/tokamakp/trunk/include | |
DEPENDPATH += $$PWD/../../Downloads/tokamakp/trunk/include |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <irrlicht.h> | |
#include <tokamak.h> | |
#include <iostream> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ISceneNode** sceneNodes; | |
neRigidBody** rigidBodies; | |
int sceneCount = 0; | |
int bodyCount = 0; | |
f32 cardmass = 1; | |
example2() | |
{ | |
sceneNodes = new ISceneNode*[PICSCOUNT]; | |
rigidBodies = new neRigidBody*[PICSCOUNT]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
neSimulatorSizeInfo siminfo; | |
neV3 gravity; | |
gravity.Set(0,-10,0); | |
siminfo.rigidBodiesCount = 100; | |
siminfo.animatedBodiesCount = 1; | |
int totalCount = siminfo.animatedBodiesCount + siminfo.rigidBodiesCount; | |
siminfo.geometriesCount = totalCount; | |
siminfo.overlappedPairsCount = totalCount * (totalCount - 1) / 2; | |
neSimulator* world = neSimulator::CreateSimulator(siminfo,NULL,&gravity); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
neAnimatedBody * floor = world->CreateAnimatedBody(); | |
neGeometry* geom = floor->AddGeometry(); | |
geom->SetBoxSize(1500,50,1500); | |
floor->UpdateBoundingInfo(); | |
neV3 pos; | |
pos.Set(0,-600,0); | |
floor->SetPos(pos); | |
ISceneNode * node = smgr->addCubeSceneNode(1); | |
node->setScale(vector3df(1500,50,1500)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ITimer * irrTimer = device->getTimer(); | |
u32 TimeStamp = irrTimer->getTime(); | |
f32 DeltaTime = 0, LastDelta = 0; | |
u32 CurrentTime = TimeStamp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LastDelta = DeltaTime; | |
CurrentTime = irrTimer->getTime(); | |
DeltaTime = CurrentTime - TimeStamp; | |
TimeStamp = CurrentTime; | |
if(LastDelta != 0) | |
{ | |
if(DeltaTime > LastDelta * 1.2f) DeltaTime = LastDelta * 1.2f; | |
if(DeltaTime < LastDelta * 0.8f) DeltaTime = LastDelta * 0.8f; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(int i = 0; i < bodyCount; i++) | |
{ | |
neRigidBody * body = rigidBodies[i]; | |
ISceneNode * node = sceneNodes[body->GetUserData()]; | |
neV3 bodyPos = body->GetPos(); | |
vector3df nodePos = tokVectorToIrrlicht(bodyPos); | |
node->setPosition(nodePos); | |
neQ bodyRot = body->GetRotationQ(); | |
quaternion nodeRotQ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vector3df cardsize(75,107,1); | |
vector3df halfcardsize = cardsize; | |
halfcardsize.Z = 0.5; | |
neRigidBody * rigid = world->CreateRigidBody(); | |
neGeometry * geom = rigid->AddGeometry(); | |
geom->SetBoxSize(irrVectorToTokamak(cardsize)); | |
rigid->UpdateBoundingInfo(); | |
rigid->SetMass(cardmass); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
verbose='' | |
while getopts vm:e:d:q:s: flag | |
do | |
case "${flag}" in | |
m) verb=${OPTARG};; | |
e) endpoint=${OPTARG};; | |
d) body="-d '${OPTARG}'";; | |
q) query=" | jq -r '${OPTARG}'";; |
OlderNewer