Topic: Starting some additional lua binding

I'm starting a code session to improve the lua integration of Maratis engine as a lot of feature are still missing,
the first wave is already on svn, with a focus on vector manipulation and object.

I added a minimal vector manipulation for 3d vector, compatible with the current table system,
allowing basic math (addition, multiplication etc), for example :

pos = (getPosition(object) + vec3(1, 0, 0)) * 2

-- it's still a table like before :
x = pos[1]
y = pos[2]
z = pos[3]

With the classic math :

length(vec)        > return a number
normalize(vec)        > return a vec3
dot(veca, vecb)        > return a number
cross(veca, vecb)    > return a vec3


Plus some object missing functions (there is still a lot missing) :

- object data
isActive(object)
getName(object)
getParent(object)
setParent(object, parent)

- to get object global coordinates (if parenting) :
getTransformedPosition(object)
getTransformedRotation(object)   
getTransformedScale(object)
   
-- some vector/matrix manipulation :
getInverseRotatedVector(object, vec)
getRotatedVector(object, vec)
getInverseVector(object, vec)
getTransformedVector(object, vec)
updateMatrix(object)
getMatrix(object) > return a table of 16 entries

Re: Starting some additional lua binding

And a second wave, the code is on svn ! :

- general :
getChilds(object) > return a list of all childs (if any)
getWindowScale() > return a table[2]
getSystemTick()

- shadows :
enableShadow(object, bool)
isCastingShadow(object)

- light properties :
setlightShadowQuality
setlightShadowBias
setlightShadowBlur
getlightShadowQuality
getlightShadowBias
getlightShadowBlur
setlightSpotAngle
setlightSpotExponent
getlightSpotAngle
getlightSpotExponent

- physics :
getMass
setMass
getFriction
setFriction
getRestitution
setRestitution
getAngularFactor
setAngularFactor
getLinearFactor
setLinearFactor
getCentralForce
getTorque

Re: Starting some additional lua binding

Nice! smile Ill go check it out now.

Re: Starting some additional lua binding

Amazing ! however i can only watch and drool :x

Re: Starting some additional lua binding

Great! Some good features, well done.

Re: Starting some additional lua binding

I need to add something to access materials properties, and maybe bones coordinates.

Other things missing ?

Re: Starting some additional lua binding

I'm thinking of get/setAnimationSpeed and get/setCurrentFrame that i saw long time ago on r68 over Here

Re: Starting some additional lua binding

Vegas : normally it was already done (I probably forgot to add it to the wiki) :
setAnimationSpeed(object, speed)
getAnimationSpeed(object)
setCurrentFrame(object, frame)
getCurrentFrame(object)

Re: Starting some additional lua binding

Oh right, that's working wink