[Bf-committers] Proposal: Mathutils types default in the BGE

Campbell Barton ideasman42 at gmail.com
Wed Jun 24 04:22:18 CEST 2009


currently the BGE using mathutils is a #define, I'll keep this for a
while to test existing games that rely on lists.
Eventually this could be made an option available to the user too.

If anyones worried about loosing precision with doubles and floats I
checked a while back and bullets using floats in our build.

Re: breaking scripts, the first script I tested with this broke,
getting some location and modifying it for use elsewhere will move the
original object, a fairly common use, though easy to fix by using
ob.position[:] or ob.position.copy()

On Tue, Jun 23, 2009 at 6:44 PM, José Ignacio<jose.cyborg at gmail.com> wrote:
> On Tue, Jun 23, 2009 at 7:51 PM, Campbell Barton<ideasman42 at gmail.com> wrote:
>> (snip)
>> Options are....
>> (snip)
>> - Campbell
>
> i give my +1 to the mathutils option, though it'd be nicer to wrap
> moto, it would be duplicated work and mathutis is already mature and
> well tested..
> also, in most of my use cases (and most of the ones i have seen),
> replacing a list for a mathutils vector/matrix doesn't break anything,
> since most tend to just index them like this:
> [code]
> op = own.position
> tp = target.position
> e = [tp[0] - op[0], tp[1] - op[1], tp[2] - op[2]]
> own.applyImpulse(op, [e[0]*5, e[1]*5, e[2]*5])
> [/code]
> Still, if there is code that relies heavily on those values being
> lists, wouldnt it be possible to override the mathutils wrapping with
> a runtime option? (i guess not but it's worth asking ;))...
>
> -cyb
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>



-- 
- Campbell


More information about the Bf-committers mailing list