예제 #1
0
        private MatrixFrame LinearInterpolatedIK(ref PathTracker pathTracker)
        {
            MatrixFrame frame;
            Vec3        color;

            pathTracker.CurrentFrameAndColor(out frame, out color);
            MatrixFrame frameForWheelsStatic = SiegeWeaponMovementComponent.FindGroundFrameForWheelsStatic(ref frame, 2.45f, 1.3f, this.SpawnedGhostEntity, this._wheels);

            return(MatrixFrame.Lerp(frame, frameForWheelsStatic, color.x));
        }
예제 #2
0
        public void SetupGhostMovement(string pathName)
        {
            this._ghostMovementMode = true;
            this._pathName          = pathName;
            Path pathWithName = this.SpawnedGhostEntity.Scene.GetPathWithName(pathName);
            Vec3 scaleVector  = this.SpawnedGhostEntity.GetFrame().rotation.GetScaleVector();

            this._tracker             = new PathTracker(pathWithName, scaleVector);
            this._ghostObjectPosition = !((NativeObject)pathWithName != (NativeObject)null) ? 0.0f : pathWithName.GetTotalLength();
            this.SpawnedGhostEntity.UpdateTriadFrameForEditor();
            List <GameEntity> children = new List <GameEntity>();

            this.SpawnedGhostEntity.GetChildrenRecursive(ref children);
            this._wheels = children.Where <GameEntity>((Func <GameEntity, bool>)(x => x.HasTag("wheel"))).ToList <GameEntity>();
        }
        protected internal override void OnAdded(Scene scene)
        {
            base.OnAdded(scene);
            this._path = scene.GetPathWithName(this.PathEntityName);
            Vec3 scaleVector = this.MainObject.GameEntity.GetFrame().rotation.GetScaleVector();

            this._wheels         = this.MainObject.GameEntity.CollectChildrenEntitiesWithTag("wheel");
            this._standingPoints = this.MainObject.GameEntity.CollectObjectsWithTag <StandingPoint>("move");
            this._pathTracker    = new PathTracker(this._path, scaleVector);
            this._pathTracker.Reset();
            this.SetTargetFrame();
            MatrixFrame globalFrame = this.MainObject.GameEntity.GetGlobalFrame();

            this._standingPointLocalIKFrames = new MatrixFrame[this._standingPoints.Count];
            for (int index = 0; index < this._standingPoints.Count; ++index)
            {
                this._standingPointLocalIKFrames[index] = this._standingPoints[index].GameEntity.GetGlobalFrame().TransformToLocal(globalFrame);
                this._standingPoints[index].AddComponent((UsableMissionObjectComponent) new ClearHandInverseKinematicsOnStopUsageComponent());
            }
        }