this is kinda what we've been asking DBS to put on thier things-to-do-soon list...
i know they want to get all the 3D and such working spick&span, but personally i'd prefer a more stable and indepth language there so we have the option of creating our own stuff on the 3D Front than having to use not quite right functions with no way of creating our own.
i've been trying to work on a way around it, but isn't getting anywhere very fast - because there is no way to determine type casting

the only current way to really achieve it is by hardcoding each type you make using a memory pointer - i'm sure there is a better way to achieve is but as of yet i'm not sure how.
currently Ian has made this for the sorta thing you mean
remstart
/*
Name: Vector.inc.dba
Desc: Vector Header File
*/ 0.01.r0.alpha
remend
`------------------------------
`// Header Declarations
`------------------------------
#constant ADDRESS dword
#constant VECTOR_EPSILON 0.01
#constant VECTOR_TABLE_SIZE 256
#constant SUCCESS 1
#constant FAIL 0
global g_Vec3 as ADDRESS
`------------------------------
`// Type Declarations
`------------------------------
type fVec3_t
x as float
y as float
z as float
endtype
`// Initilise the Vectors
if ( FAIL=InitVectors() )
exit prompt "Error","Unable to Access Vector Tables"
endif
`/* -----------------------------
` Name: InitVectors()
` Desc: Initialise Vector Table
` ----------------------------- */
function InitVectors( )
`{
local result as boolean = FAIL
`// setup Vector3 Table
if g_Vec3=0
g_Vec3=make memory(12*VECTOR_TABLE_SIZE+12)
fill memory g_Vec3,0,12*VECTOR_TABLE_SIZE
result=SUCCESS
endif
endfunction result
`}
`/* -----------------------------
` Name: ReleaseVectors()
` Desc: Releases Vector Tables
` ----------------------------- */
function ReleaseVectors( )
`{
local result as boolean = FAIL
`// release Vector3 Table
if g_Vec3<>0
delete memory *g_Vec3
result=SUCCESS
endif
endfunction result
`}
`/* ------------------------------------
` Name: GetVec3Addr()
` Desc: Returns the address pointer of
` of the given Vector
` ------------------------------------ */
function GetVec3Addr( Vector as integer )
`{
local Addr as ADDRESS
if Vector<0 or Vector>VECTOR_TABLE_SIZE
Vector=NULL
endif
Addr=g_Vec3+( 12*Vector )
endfunction Addr
`}
`/* ------------------------------------
` Name: SET_VECTOR3
` Desc: Sets the Vector3 Vector Points
` ------------------------------------ */
function SET_VECTOR3( Vector as dword, _
x as float, y as float, z as float )
`{
local Addr as ADDRESS
Addr=GetVec3Addr( Vector )
*Addr=x
Addr=Addr+4
*Addr=y
Addr=Addr+4
*Addr=z
endfunction
`}
`/* ------------------------------------
` Name: VEC3_X|Y|Z()
` Desc: Returns the address pointer of
` of the given Vector
` ------------------------------------ */
function VEC3_X( Vector as integer )
`{
local Addr as ADDRESS
local result as float
Addr=GetVec3Addr( Vector )
result=*Addr
endfunction result
`}
function VEC3_Y( Vector as integer )
`{
local Addr as ADDRESS
local result as float
Addr=GetVec3Addr( Vector )+4
result=*Addr
endfunction result
`}
function VEC3_Z( Vector as integer )
`{
local Addr as ADDRESS
local result as float
Addr=GetVec3Addr( Vector )+8
result=*Addr
endfunction result
`}
remstart
/*
Copyright© 2003 FMTau Labs, LLC. All Rights Reserved.
*/ 0.01.r0.alpha
remend
it would be possible to develop an editor which would be able to be recoded and use this with the object orientation that current types use ... but without a way of determining what the next section of data is setup in there is no real way to make this a universal setup right now for some true passing
a good example of howto use this would be like this
`//#include <vector.inc.dba>
#constant TRUE=(1=1)
#constant FALSE=(1=0)
InitVectors() :`// initilise vector table
IsTrue as boolean
`// grab vector points
MyVectorA as dword = GetVec3Addr( 1 )
MyVectorB as dword = GetVec3Addr( 2 )
`// set vector values
SET_VECTOR3( MyVectorA, 0.0, 1.0, 0.0 )
SET_VECTOR3( MyVectorB, 0.0, 1.0, 0.01 )
IsTrue = VectorCompare( MyVectorA, MyVectorB )
if IsTrue=TRUE
print "Vectors are the Same"
else
print "Vectors are Different"
endif
wait key
ReleaseVectors() :`// make sure you release else you get memory leaks!!
function VectorCompare(Vec1 as dword, Vec2 as dword)
`{
local i as integer
local result as boolean
local dim v1(2) as float
v1(0)=VEC3_X(Vec1) : v1(1)=VEC3_Y(Vec1) : v1(2)=VEC3_Z(Vec1)
local dim v2(2) as float
v2(0)=VEC3_X(Vec2) : v2(1)=VEC3_Y(Vec2) : v1(2)=VEC3_Z(Vec2)
for i=0 to 2
if (abs(v1[i]-v2[i]) > VECTOR_EPSILON)
result=FALSE
undim v1(2) : undim v2(2)
exitfunction result
endif
next i
result=TRUE
undim v1(2) : undim v2(2)
endfunction result
`} boolean
pretty cool eh
Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?