コード例 #1
0
        public SPhysics(MorroFactory factory, uint targetFramerate, Integrator integrator) : base(factory)
        {
            Require(typeof(CPosition), typeof(CKinetic));

            target          = 1f / targetFramerate;
            this.integrator = integrator;
        }
コード例 #2
0
        /// <summary>
        /// Create a <see cref="HybridSystem"/> that helps process, manipulate, and draw <see cref="GeometryData"/>.
        /// By default, this system will handle any entity that includes the following components: <see cref="CPosition"/>, <see cref="CDimension"/>, <see cref="CTransform"/>, <see cref="CColor"/>,
        /// and a custom <see cref="IComponent"/> that acts as a tag specifically for this system.
        /// </summary>
        /// <param name="factory">The scene this system will exist in.</param>
        /// <param name="geometry">The shape data that this system will focus on and draw.</param>
        /// <param name="renderOptions">The render options that should be used to draw the geometry.</param>
        /// <param name="shapeTag">The type of a custom <see cref="IComponent"/> that acts as a tag specifically for this system.</param>
        public SimpleShapeSystem(MorroFactory factory, GeometryData geometry, RenderOptions renderOptions, Type shapeTag) : base(factory)
        {
            Require(typeof(CPosition), typeof(CDimension), typeof(CTransform), typeof(CColor), shapeTag);

            this.geometry      = geometry;
            this.renderOptions = renderOptions;

            transformData = new VertexTransform[factory.EntityCapacity];
            colorData     = new VertexColor[factory.EntityCapacity];
        }
コード例 #3
0
ファイル: SBinPartitioner.cs プロジェクト: thismarvin/relatus
 /// <summary>
 /// Creates an implementation of a <see cref="PartitioningSystem"/> that implements a <see cref="Bin{T}"/>.
 /// </summary>
 /// <param name="factory">The scene this system will exist in.</param>
 /// <param name="boundary">The area the partitioner will cover.</param>
 /// <param name="maximumDimension">The maximum expected size of any entity inserted into the bin.</param>
 public SBinPartitioner(MorroFactory factory, RectangleF boundary, uint maximumDimension) : base(factory)
 {
     partitioner = new Bin <PartitionerEntry>(boundary, maximumDimension);
 }
コード例 #4
0
 public PartitioningSystem(MorroFactory factory) : base(factory)
 {
     Require(typeof(CPosition), typeof(CDimension), typeof(CPartitionable));
 }
コード例 #5
0
 /// <summary>
 /// Creates an implementation of a <see cref="PartitioningSystem"/> that implements a <see cref="Quadtree{T}"/>.
 /// </summary>
 /// <param name="factory">The scene this system will exist in.</param>
 /// <param name="boundary">The area the partitioner the will cover.</param>
 /// <param name="nodeCapacity">The total amount of entities that exist in a node before overflowing into a new tree.</param>
 public SQuadtreePartitioner(MorroFactory factory, RectangleF boundary, uint nodeCapacity) : base(factory)
 {
     partitioner = new Quadtree <PartitionerEntry>(boundary, nodeCapacity);
 }
コード例 #6
0
 public SSprite(MorroFactory factory) : base(factory)
 {
     Require(typeof(CSprite), typeof(CPosition), typeof(CTransform));
 }