示例#1
0
文件: View.cs 项目: sachgits/Myre
        public override void CreateProperties(Entity.InitialisationContext context)
        {
            this.camera   = context.CreateProperty <Camera>("camera");
            this.viewport = context.CreateProperty <Viewport>("viewport");

            base.CreateProperties(context);
        }
示例#2
0
        public override void CreateProperties(Entity.InitialisationContext context)
        {
            this.skyColour    = context.CreateProperty <Vector3>("sky_colour");
            this.groundColour = context.CreateProperty <Vector3>("ground_colour");
            this.up           = context.CreateProperty <Vector3>("up");

            base.CreateProperties(context);
        }
示例#3
0
        public override void CreateProperties(Entity.InitialisationContext context)
        {
            this.model     = context.CreateProperty <ModelData>("model");
            this.transform = context.CreateProperty <Matrix>("transform");
            this.isStatic  = context.CreateProperty <bool>("is_static");

            base.CreateProperties(context);
        }
示例#4
0
文件: SunLight.cs 项目: sachgits/Myre
        public override void CreateProperties(Entity.InitialisationContext context)
        {
            this.colour           = context.CreateProperty <Vector3>("colour");
            this.direction        = context.CreateProperty <Vector3>("direction");
            this.shadowResolution = context.CreateProperty <int>("shadow_resolution");

            base.CreateProperties(context);
        }
示例#5
0
文件: Skybox.cs 项目: sachgits/Myre
        public override void CreateProperties(Entity.InitialisationContext context)
        {
            this.texture      = context.CreateProperty <TextureCube>("texture");
            this.brightness   = context.CreateProperty <float>("brightness");
            this.gammaCorrect = context.CreateProperty <bool>("gamma_correct");

            base.CreateProperties(context);
        }
示例#6
0
        public override void CreateProperties(Entity.InitialisationContext context)
        {
            colour   = context.CreateProperty <Vector3>("colour");
            position = context.CreateProperty <Vector3>("position");
            range    = context.CreateProperty <float>("range");

            base.CreateProperties(context);
        }
示例#7
0
        public override void CreateProperties(Entity.InitialisationContext context)
        {
            velocity     = context.CreateProperty <Vector3>("velocity");
            acceleration = context.CreateProperty <Vector3>("acceleration");
            inverseMass  = context.CreateProperty <float>(InverseMassCalculator.INVERSE_MASS);

            base.CreateProperties(context);
        }
示例#8
0
文件: Geometry.cs 项目: sachgits/Myre
        public override void CreateProperties(Entity.InitialisationContext context)
        {
            frictionCoefficient    = context.CreateProperty <float>("friction_coefficient");
            restitutionCoefficient = context.CreateProperty <float>("restitution_coefficient");
            sleeping = context.CreateProperty <bool>("sleeping");

            restitutionCoefficient.PropertyChanged += ValidateRestitution;
            sleeping.PropertyChanged += WakeUp;

            base.CreateProperties(context);
        }
示例#9
0
        public override void CreateProperties(Entity.InitialisationContext context)
        {
            var prefix = Name != null ? Name + "_" : string.Empty;

            transformProperty = context.CreateProperty <Matrix>("transform", Matrix.Identity);
            verticesProperty  = context.CreateProperty <Vector2[]>(prefix + "vertices");

            transformProperty.PropertyChanged += p => ApplyTransform();
            verticesProperty.PropertyChanged  += p => ReadVertices(p);

            base.CreateProperties(context);
        }
示例#10
0
        public override void CreateProperties(Entity.InitialisationContext context)
        {
            this.colour           = context.CreateProperty <Vector3>("colour");
            this.position         = context.CreateProperty <Vector3>("position");
            this.direction        = context.CreateProperty <Vector3>("direction");
            this.angle            = context.CreateProperty <float>("angle");
            this.range            = context.CreateProperty <float>("range");
            this.mask             = context.CreateProperty <Texture2D>("mask");
            this.shadowResolution = context.CreateProperty <int>("shadow_resolution");

            base.CreateProperties(context);
        }
示例#11
0
        public override void CreateProperties(Entity.InitialisationContext context)
        {
            this.position         = context.CreateProperty <Vector2>(PhysicsProperties.POSITION);
            this.rotation         = context.CreateProperty <float>(PhysicsProperties.ROTATION);
            this.transform        = context.CreateProperty <Matrix>("transform");
            this.inverseTransform = context.CreateProperty <Matrix>("inverse_transform");

            position.PropertyChanged += _ => isDirty = true;
            rotation.PropertyChanged += _ => isDirty = true;

            base.CreateProperties(context);
        }
示例#12
0
文件: Circle.cs 项目: sachgits/Myre
        public override void CreateProperties(Entity.InitialisationContext context)
        {
            var prefix = Name != null ? Name + "_" : string.Empty;

            radius    = context.CreateProperty <float>(prefix + "radius");
            centre    = context.CreateProperty <Vector2>(prefix + "centre");
            transform = context.CreateProperty <Matrix>("transform", Matrix.Identity);

            radius.PropertyChanged    += _ => UpdateBounds();
            centre.PropertyChanged    += _ => UpdateBounds();
            transform.PropertyChanged += _ => UpdateBounds();

            base.CreateProperties(context);
        }
示例#13
0
        public override void CreateProperties(Entity.InitialisationContext context)
        {
            this.position            = context.CreateProperty <Vector2>(PhysicsProperties.POSITION);
            this.rotation            = context.CreateProperty <float>(PhysicsProperties.ROTATION);
            this.mass                = context.CreateProperty <float>(PhysicsProperties.MASS);
            this.inertiaTensor       = context.CreateProperty <float>(PhysicsProperties.INERTIA_TENSOR);
            this.linearVelocity      = context.CreateProperty <Vector2>(PhysicsProperties.LINEAR_VELOCITY);
            this.angularVelocity     = context.CreateProperty <float>(PhysicsProperties.ANGULAR_VELOCITY);
            this.linearVelocityBias  = context.CreateProperty <Vector2>(PhysicsProperties.LINEAR_VELOCITY_BIAS);
            this.angularVelocityBias = context.CreateProperty <float>(PhysicsProperties.ANGULAR_VELOCITY_BIAS);
            this.linearAcceleration  = context.CreateProperty <Vector2>(PhysicsProperties.LINEAR_ACCELERATION);
            this.angularAcceleration = context.CreateProperty <float>(PhysicsProperties.ANGULAR_ACCELERATION);
            this.timeMultiplier      = context.CreateProperty <float>(PhysicsProperties.TIME_MULTIPLIER);
            this.sleeping            = context.CreateProperty <bool>(PhysicsProperties.SLEEPING);

            base.CreateProperties(context);
        }
示例#14
0
 /// <summary>
 /// Initialises this instance.
 /// </summary>
 /// <param name="context">
 /// Initialisation context. This object can be used to publish properties to the owning entity.
 /// </param>
 /// <remarks>
 /// CreatePropeties is called once when the entity is constructed.
 /// Here the behaviour should create any properties required by this behaviour to function.
 /// Create properties is called before Initialise.
 /// </remarks>
 public virtual void CreateProperties(Entity.InitialisationContext context)
 {
 }
示例#15
0
        public override void CreateProperties(Entity.InitialisationContext context)
        {
            this.position = context.CreateProperty <Vector3>("position");

            base.CreateProperties(context);
        }