TrueAxis physics wrapper Windows/Linux 32/64-bit.

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
D.J.Peters
Posts: 6999
Joined: May 28, 2005 3:28
Location: Germany

TrueAxis physics wrapper Windows/Linux 32/64-bit.

Postby D.J.Peters » Apr 29, 2014 23:01

TrueAxis physics wrapper for FreeBASIC.

download: TrueAxisWrapper.zip from Wed Jun 15, 2016

True Axis FreeBASIC Wrapper documentation first version
download: TrueAxisWrapper.chm
online: TrueAxisWrapper.html



how to start:
extract the zip archive with folder

copy the right lib to the right place

cd TrueAxisWrapper

Linux x86:
sudo cp *x86.so /usr/lib

Linux x86_64:
sudo cp *x86_64.so /usr/lib

password: ****
chmod +x build_all.sh
./build_all.sh

Windows:
copy the 32 or 64-bit dll to X:\windows\system32
execute build_all.bat

Joshy
Last edited by D.J.Peters on Jun 15, 2016 9:14, edited 12 times in total.
D.J.Peters
Posts: 6999
Joined: May 28, 2005 3:28
Location: Germany

Re: TrueAxis physics wrapper (Win32, Linux x86)

Postby D.J.Peters » May 07, 2014 12:15

Test7.bas added
First very simple test of class CarTemplate.
youtube: http://www.youtube.com/watch?v=5L0S_7G8z_E

Joshy

Code: Select all

function CreateSimpleCar(carwidth as single=2,carheight as single=1.2,carlength as single=4) as DynamicObjectCar ptr
  ' create a car from CarTemplate
  dim as CarTemplate ptr CarDesc = CarTemplateCreateNew()
  CarTemplateBeginInitialise(CarDesc)

  ' add car CollisionObject (a simple box in this case)
  dim as CollisionObjectConvex ptr Convex = CollisionObjectConvexCreateNew()
  CollisionObjectConvexInitialiseAsABox Convex,0,CarHeight/8,0,CarWidth/2,CarHeight/2,CarLength/2
  CarTemplateAddCollisionObjectConvex CarDesc,Convex
  ' we no longer need the collision box here.
  CollisionObjectConvexRelease Convex

  ' add wheels
 
  ' steering front wheels
  const as single fWheelTop    =   0.0
  const as single fWheelBottom =  -1.0
  dim   as single fWheelXPos   =  (CarWidth -fWheelWidth/2)/2
  dim   as single fWheelZPos   =  (CarLength-fWheelSize   )/2

  ' rear wheels
  const as single bWheelTop    =  0.0
  const as single bWheelBottom = -1.0
  dim   as single bWheelXPos   =  (CarWidth -fWheelWidth/2)/2
  dim   as single bWheelZPos   = -(CarLength-fWheelSize   )/2


  'CarTemplateWheelSetSuspensionSpringConstant (40000)
  'CarTemplateWheelSetSuspensionDampingConstant(10000)

  CarTemplateWheelSetRadius(fWheelSize/2) ' radius
  CarTemplateWheelSetSteeringFlag  IS_ON
  CarTemplateWheelSetDrivingFlag   IS_OFF
  CarTemplateWheelSetHandBrakeFlag IS_OFF

  ' Front wheels
  CarTemplateWheelSetSuspensionTop    fWheelXPos,fWheelTop   ,fWheelZPos
  CarTemplateWheelSetSuspensionBottom fWheelXPos,fWheelBottom,fWheelZPos
  CarTemplateAddWheel(CarDesc)   
 
  CarTemplateWheelSetSuspensionTop    -fWheelXPos,fWheelTop,   fWheelZPos
  CarTemplateWheelSetSuspensionBottom -fWheelXPos,fWheelBottom,fWheelZPos
  CarTemplateAddWheel CarDesc

  CarTemplateWheelSetRadius bWheelSize/2
  CarTemplateWheelSetSteeringFlag  IS_OFF
  CarTemplateWheelSetDrivingFlag   IS_ON
  CarTemplateWheelSetHandBrakeFlag IS_ON

  if 1 then   '  6 wheel vehicle
    CarTemplateWheelSetSuspensionTop    bWheelXPos,bWheelTop   ,bWheelZPos+bWheelSize+0.1
    CarTemplateWheelSetSuspensionBottom bWheelXPos,bWheelBottom,bWheelZPos+bWheelSize+0.1
    CarTemplateAddWheel CarDesc
 
    CarTemplateWheelSetSuspensionTop    -bWheelXPos,bWheelTop   ,bWheelZPos+bWheelSize+0.1
    CarTemplateWheelSetSuspensionBottom -bWheelXPos,bWheelBottom,bWheelZPos+bWheelSize+0.1
    CarTemplateAddWheel CarDesc
  end if
 
  ' Rear wheels
  CarTemplateWheelSetSuspensionTop    bWheelXPos,bWheelTop   ,bWheelZPos
  CarTemplateWheelSetSuspensionBottom bWheelXPos,bWheelBottom,bWheelZPos
  CarTemplateAddWheel CarDesc
 
  CarTemplateWheelSetSuspensionTop    -bWheelXPos,bWheelTop   ,bWheelZPos
  CarTemplateWheelSetSuspensionBottom -bWheelXPos,bWheelBottom,bWheelZPos
  CarTemplateAddWheel CarDesc
   
 
  CarTemplateSetMass CarDesc,carwidth*carheight*carlength*100
  CarTemplateSetTorqueMultiplier CarDesc,2.0
  CarTemplateSetDownForce CarDesc,4.0
 
  CarTemplateEndInitialise CarDesc

  ' create a DynamicObjectCar from our CarTemplate
  dim as DynamicObjectCar ptr NewCar = DynamicObjectCarCreateNew()
  DynamicObjectCarInitialise NewCar,CarDesc
  ' we no longer need the CarTemplate here.
  CarTemplateRelease CarDesc
  ' add the car to the physics simulation
  PhysicsAddDynamicObject NewCar
  return NewCar
end function
Last edited by D.J.Peters on Jun 15, 2016 9:14, edited 1 time in total.
D.J.Peters
Posts: 6999
Joined: May 28, 2005 3:28
Location: Germany

Re: TrueAxis physics wrapper (Win32, Linux x86)

Postby D.J.Peters » May 10, 2014 9:12

New version published.

added:
SurfaceAttributeSetUserData
SurfaceAttributeGetUserData

changed:
all class Realese mehods set the class pointer to NULL (byref)

Joshy
Last edited by D.J.Peters on Mar 11, 2015 5:21, edited 1 time in total.
badidea
Posts: 542
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: TrueAxis physics wrapper (Win32, Linux x86)

Postby badidea » May 12, 2014 21:05

"340 sub's and functions"

A lot of work, nice!

Can you crash 2 cars? Maybe under a small angle to make the result more interesting?

Or a train crash with wagons loaded with wood :-)
D.J.Peters
Posts: 6999
Joined: May 28, 2005 3:28
Location: Germany

Re: TrueAxis physics wrapper (Win32, Linux x86)

Postby D.J.Peters » May 15, 2014 14:33

short video: 500 cars
Last edited by D.J.Peters on Jul 19, 2014 14:11, edited 1 time in total.
D.J.Peters
Posts: 6999
Joined: May 28, 2005 3:28
Location: Germany

Re: TrueAxis physics wrapper (Win32, Linux x86)

Postby D.J.Peters » May 15, 2014 14:36

badidea wrote:A lot of work
You are right it's more as an simple wrapper I modified the car class and added more stability.

Joshy
D.J.Peters
Posts: 6999
Joined: May 28, 2005 3:28
Location: Germany

Re: TrueAxis physics wrapper (Win32, Linux x86)

Postby D.J.Peters » May 15, 2014 20:40

Cars in a sandbox :-)

Joshy
Last edited by D.J.Peters on Jul 19, 2014 14:11, edited 1 time in total.
badidea
Posts: 542
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: TrueAxis physics wrapper (Win32, Linux x86)

Postby badidea » May 15, 2014 20:54

Dakar Rally!
D.J.Peters
Posts: 6999
Joined: May 28, 2005 3:28
Location: Germany

Re: TrueAxis physics wrapper (Win32, Linux x86)

Postby D.J.Peters » May 15, 2014 21:09

Last edited by D.J.Peters on Jul 19, 2014 14:12, edited 1 time in total.
D.J.Peters
Posts: 6999
Joined: May 28, 2005 3:28
Location: Germany

Re: TrueAxis physics wrapper (Win32, Linux x86)

Postby D.J.Peters » May 16, 2014 23:49

Last edited by D.J.Peters on Jul 19, 2014 14:12, edited 1 time in total.
D.J.Peters
Posts: 6999
Joined: May 28, 2005 3:28
Location: Germany

Re: TrueAxis physics wrapper (Win32, Linux x86)

Postby D.J.Peters » May 26, 2014 6:02

Last edited by D.J.Peters on Jul 20, 2014 7:35, edited 1 time in total.
D.J.Peters
Posts: 6999
Joined: May 28, 2005 3:28
Location: Germany

Re: TrueAxis physics wrapper (Win32, Linux x86)

Postby D.J.Peters » Jun 02, 2014 2:20

Last edited by D.J.Peters on Jan 04, 2015 5:36, edited 1 time in total.
angros47
Posts: 1264
Joined: Jun 21, 2005 19:04

Re: TrueAxis physics wrapper (Win32, Linux x86)

Postby angros47 » Jun 02, 2014 9:32

Nice!

Are you using your own routines to load cars, and to build the terrain, or some 3d engine?

To use it in linux, you don't need to be superuser and copy the library in usr/lib, you could do:

cd TrueAxisWrapper
fbc Test01.bas
LD_LIBRARY_PATH=./:$LD_LIBRARY_PATH ./Test01
D.J.Peters
Posts: 6999
Joined: May 28, 2005 3:28
Location: Germany

Re: TrueAxis physics wrapper (Win32, Linux x86)

Postby D.J.Peters » Jul 19, 2014 14:19

You can download the lates version with round about 670 functions.

Joshy
D.J.Peters
Posts: 6999
Joined: May 28, 2005 3:28
Location: Germany

Re: TrueAxis physics wrapper (Win32, Linux x86)

Postby D.J.Peters » Aug 08, 2014 21:12

Curently I build and test TrueAxis for FreeBasic Windows 64 bit, Linux_x86_64, ARM6 and ARM7.

Joshy

FreeBasic & TrueAxis (OpenGL) on raspberry pi arm cpu..
Image
Last edited by D.J.Peters on Aug 10, 2014 0:27, edited 1 time in total.

Return to “Libraries”

Who is online

Users browsing this forum: No registered users and 2 guests