Very simple physic wrapper :)

Blitz3D Forums/Blitz3D Userlibs/Very simple physic wrapper :)

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

It is a first attempt to create physic wrapper with minimum functions :)

To introduce entity to physics use wdDynamic(entity) or wdStatic(entity).

wdSetControl(entity,True) will make entity controllable through standart blitz functions (PositionEntity,RotateEntity,MoveEntity,TurnEntity)

Example:
; Create graphics
Graphics3D 600,600,32,2
cam = CreateCamera()
PositionEntity cam,0,10,-20
light = CreateLight()
SetFont LoadFont("Courier New",20)

; Load mesh
Entity = CreateCube()

; Position and rotate
PositionEntity entity,0,20,0
RotateEntity entity,60,60,60

;====================================
;== (wd) Physicalize this mesh as dynamic entity ==
;====================================
wdDynamic(entity)


; Create plane
plane = CreatePlane()
EntityColor plane,150,170,255
EntityAlpha plane,.8
CreateMirror(plane)

;==================================
;== (wd) Physicalize the plane as static entity ==
;==================================
wdStatic(plane)

; Main loop
While Not(KeyHit(1))


	;== (wd) Update physics by 0.01 seconds ==
	wdUpdatePhysic(0.01)
	
	; Render 
	RenderWorld
	Flip
Wend


dll, decls and 3 samples is here:
http://itmbin.nm.ru/newton/nwmini.zip

Any comments and ideas are welcome :)