realistic "space" physics?

Blitz3D Forums/Blitz3D Programming/realistic "space" physics?

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.

I did it. :D

I acheived it by parenting the ship mesh to a pivot. Here's the code I used:

	Local mxspd#, myspd#, zoom#
	Local xspd#, yspd#, zspd#	
	
	; Mouse rotation
	mxspd = MouseXSpeed() * .2
	myspd = MouseYSpeed() * .2
	
	MoveMouse GraphicsHeight()/2, GraphicsWidth()/2
	
	If MouseDown(2) Then
		TurnEntity player\obj, myspd, 0, mxspd
	Else
		TurnEntity player\obj, myspd, -mxspd, 0
	End If
	
	If KeyDown(KEY_S) Then
		MoveEntity player\obj, 0, 0, .01
	
		xspd = EntityX(player\obj)
		yspd = EntityY(player\obj)
		zspd = EntityZ(player\obj)
	
		MoveEntity player\obj, 0, 0, -.01
	
		player\h = player\h + xspd
		player\v = player\v + yspd
		player\d = player\d + zspd
	End If

	TranslateEntity player\piv, player\h, player\v, player\d


This probably isn't the best way of doing it, but it sure does work!