public void Init(EcsSystems systems) { var world = systems.GetWorld(worldName); _filter = world.Filter <T> ().End(); _pool = world.GetPool <T> (); }
public void Init(EcsSystems systems) { var world = systems.GetWorld(); boundingCircles = world.Filter <BoundingCircle>().End(); meshes = world.Filter <Mesh>().Inc <Pose>().End(); }
public void Init(EcsSystems systems) { var worldConstraints = systems.GetWorld(PhysicsWorldNames.Constraints); springsBodyBody = worldConstraints.Filter <SpringBodyBody>().End(); springsBodySpace = worldConstraints.Filter <SpringBodySpace>().End(); }
public void Init(EcsSystems systems) { var world = systems.GetWorld(); circles = world.Filter <RigidBody>().Inc <Circle>().Inc <BoundingBox>().End(); meshes = world.Filter <RigidBody>().Inc <Mesh>().Inc <BoundingBox>().End(); grabberElasticityCoefficient = 40f; }
public void Init(EcsSystems systems) { var world = systems.GetWorld(); shapes = world.Filter <Shape>().Inc <BoundingBox>().End(); shapesPool = world.GetPool <Shape>(); boundingBoxes = world.GetPool <BoundingBox>(); }
public void Init(EcsSystems systems) { var worldEvents = systems.GetWorld(PhysicsWorldNames.Events); var physicsData = systems.GetShared <PhysicsData>(); contacts = worldEvents.Filter <Contact <TagA, TagB> >().End(); contactsPool = worldEvents.GetPool <Contact <TagA, TagB> >(); RegisterSolver(worldEvents, physicsData.ContactSolversMatrix); }
public void Init(EcsSystems systems) { var worldEvents = systems.GetWorld(PhysicsWorldNames.Events); var physicsData = systems.GetShared <PhysicsData>(); possibleContacts = worldEvents.Filter <PossibleContact <ShapeA, ShapeB> >().End(); possibleContactsPool = worldEvents.GetPool <PossibleContact <ShapeA, ShapeB> >(); contactSolversMatrix = physicsData.ContactSolversMatrix; RegisterTester(worldEvents, physicsData.ContactTestersMatrix); }
public void Run(EcsSystems systems) { var world = systems.GetWorld(); var entities = world.Filter <UIPosition>().Inc <UIText>().End(); var positionPool = world.GetPool <UIPosition>(); var textPool = world.GetPool <UIText>(); foreach (var entity in entities) { ref UIPosition pos = ref positionPool.Get(entity); ref UIText text = ref textPool.Get(entity);
static bool InjectWorld(FieldInfo fieldInfo, IEcsSystem system, EcsSystems systems) { if (fieldInfo.FieldType == WorldType) { if (Attribute.IsDefined(fieldInfo, WorldAttrType)) { var worldAttr = (EcsWorldAttribute)Attribute.GetCustomAttribute(fieldInfo, WorldAttrType); fieldInfo.SetValue(system, systems.GetWorld(worldAttr.World)); } return(true); } return(false); }
public void Run(EcsSystems systems) { var worldConstraints = systems.GetWorld(PhysicsWorldNames.Constraints); var sharedData = systems.GetShared <SharedData>(); var factory = sharedData.ObjectsFactory; var keys = sharedData.Keys; var mousePositionWorld = keys.GetMousePosition() * sharedData.RenderData.PixelsToMeters; if (isActive && keys[MouseButtons.Left]) { ref var spring = ref springsBodySpace.Get(springEntity); spring.AttachmentPointSpace = mousePositionWorld; }
static bool InjectPool(FieldInfo fieldInfo, IEcsSystem system, EcsSystems systems) { if (fieldInfo.FieldType.IsGenericType && fieldInfo.FieldType.GetGenericTypeDefinition() == PoolType) { if (Attribute.IsDefined(fieldInfo, PoolAttrType)) { var poolAttr = (EcsPoolAttribute)Attribute.GetCustomAttribute(fieldInfo, PoolAttrType); var world = systems.GetWorld(poolAttr.World); var componentTypes = fieldInfo.FieldType.GetGenericArguments(); fieldInfo.SetValue(system, GetGenericGetPoolMethod(componentTypes[0]).Invoke(world, null)); } return(true); } return(false); }
public void Init(EcsSystems systems) { var world = systems.GetWorld(); segments = world.Filter <Segment>().End(); }
public void Init(EcsSystems systems) { var world = systems.GetWorld(); bodies = world.Filter <RigidBody>().Inc <Pose>().Inc <Velocity>().End(); }
public void Init(EcsSystems systems) { var world = systems.GetWorld(); bodies = world.Filter <BodyMask>().Inc <BoundingBox>().End(); }
public void Init(EcsSystems systems) { var world = systems.GetWorld(); aaboxes = world.Filter <AABox>().Inc <BoundingBox>().End(); }