Esempio n. 1
0
        public override void Follow(GraphicEntity follower, GraphicEntity target)
        {
            var cameraPostion = target.GetComponent <GeneralCameraComponent>().Position;

            var worldMatrix = Matrix4x4.CreateTranslation(cameraPostion.X, cameraPostion.Y, cameraPostion.Z);

            follower.UpdateComponent(TransformComponent.Create(worldMatrix));
        }
Esempio n. 2
0
        protected override void OnExecuting(GraphicEntity entity, ref LightComponent light, ref ColorComponent color, ISceneSnapshot snapshot)
        {
            if (entity.Contains <FollowCameraDirectLightComponent>() && light.Direction != snapshot.Camera.LookDirection)
            {
                entity.UpdateComponent(light.ApplyDirection(snapshot.Camera.LookDirection));
            }

            base.OnExecuting(entity, ref light, ref color, snapshot);
        }