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 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) }; }