Exemple #1
0
        void moveEntity(ent.EntityId id)
        {
            var(tx, entOpt) = m_db.checkout(id);

            using ( tx )
            {
                if (!entOpt.HasValue)
                {
                    return;
                }

                var ent = entOpt.ValueOr((ent.Entity)null);

                var physOpt = ent.com <ent.ComPhysics>();

                physOpt.Match((phys) => {
                    // TODO METRICS

                    var scaledVel = Vec.Multiply(phys.vel, 1.0f / 60.0f);

                    var newPos = Vec.Add(phys.pos, scaledVel);

                    var newPosOpt = newPos.Value.Some();

                    var newPhys = phys.with(posOpt: newPosOpt);

                    //var newComs = ent.m_coms.Replace( phys, newPhys )

                    //ent.with()
                },
                              () => {
                    // TODO METRICS
                });
            }
        }
        public Vector128 <float> Foo(Vector128 <float> left, Vector128 <float> right)
        {
            var comp = MVector.CompareEqual(left, right);
            var mul  = MVector.Multiply(left, right);
            var sqrt = MVector.Sqrt(mul);

            return(MVector.Select(comp, mul, sqrt));
        }
Exemple #3
0
        public void test()
        {
            Vec4 v1 = Vec4.Zero;
            Vec4 v2 = Vec4.Zero;

            var v3 = Vec.Add(v1, v2);

            var pos = new Pos {
                pos = Vector128.Create(0.0f, 0.0f, 0.0f, 0.0f)
            };
        }