• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Math.Vector3D类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Mooege.Core.GS.Common.Types.Math.Vector3D的典型用法代码示例。如果您正苦于以下问题:C# Vector3D类的具体用法?C# Vector3D怎么用?C# Vector3D使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Vector3D类属于Mooege.Core.GS.Common.Types.Math命名空间,在下文中一共展示了Vector3D类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: InteractiveNPC

 public InteractiveNPC(World world, int actorSNO, Vector3D position)
     : base(world, actorSNO, position)
 {
     this.Attributes[GameAttribute.NPC_Has_Interact_Options, 0] = true;
     this.Attributes[GameAttribute.NPC_Is_Operatable] = true;
     this.Attributes[GameAttribute.Buff_Visual_Effect, 0x00FFFFF] = true;
 }
开发者ID:keltins,项目名称:mooege,代码行数:7,代码来源:InteractiveNPC.cs


示例2: Projectile

        public Projectile(PowerContext context, int actorSNO, Vector3D position)
            : base(context.World, actorSNO)
        {
            this.Field2 = 0x8;
            this.Scale = 1.35f;
            // just use default? GBHandle.Projectile is 10, but most projectiles I see use 17
            //this.GBHandle.Type = (int)GBHandleType.Projectile; this.GBHandle.GBID = 1;
            this.Field7 = 0x00000001;
            // these no longer needed?
            //this.Field10 = 0x1;
            //this.Field11 = 0x1;
            //this.Field12 = 0x1;
            //this.Field13 = 0x1;
            //this.CollFlags = 0x4;
            
            this.Context = context;
            this.Position = new Vector3D(position);
            this.Timeout = new SecondsTickTimer(context.World.Game, 2f);  // 2 second default timeout for projectiles

            // copy in important effect params from user
            this.Attributes[GameAttribute.Rune_A, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_A, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_B, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_B, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_C, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_C, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_D, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_D, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_E, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_E, context.PowerSNO];

            _arrivalTime = null;
            _lastUpdateTick = 0;
            _prevUpdatePosition = null;
            _onArrivalCalled = false;

            // offset position by mpq collision data
            this.Position.Z += this.ActorData.Cylinder.Ax1 - this.ActorData.Cylinder.Position.Z;
        }
开发者ID:n3rus,项目名称:mooege,代码行数:34,代码来源:Projectile.cs


示例3: Parse

 /// <summary>
 /// Parses AABB from given GameBitBuffer.
 /// </summary>
 /// <param name="buffer">The GameBitBuffer to parse from.</param>
 public void Parse(GameBitBuffer buffer)
 {
     Min = new Vector3D();
     Min.Parse(buffer);
     Max = new Vector3D();
     Max.Parse(buffer);
 }
开发者ID:loonbg,项目名称:mooege,代码行数:11,代码来源:AABB.cs


示例4: Living

        public Living(World world, int actorSNO, Vector3D position, Dictionary<int, TagMapEntry> tags)
            : base(world, world.NewActorID, position, tags )
        {
            this.SNOId = actorSNO;
            // FIXME: This is hardcoded crap
            this.Field3 = 0x0;
            this.RotationAmount = (float)(RandomHelper.NextDouble() * 2.0f * Math.PI);
            this.RotationAxis.X = 0f; this.RotationAxis.Y = 0f; this.RotationAxis.Z = 1f;
            this.GBHandle.Type = -1; this.GBHandle.GBID = -1;
            this.Field7 = 0x00000001;
            this.Field8 = this.SNOId;
            this.Field10 = 0x0;
            this.Field11 = 0x0;
            this.Field12 = 0x0;
            this.Field13 = 0x0;
            this.AnimationSNO = 0x11150;
            this.CollFlags = 1;

            this.Attributes[GameAttribute.Hitpoints_Max_Total] = 4.546875f;
            this.Attributes[GameAttribute.Hitpoints_Max] = 4.546875f;
            this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 0f;
            this.Attributes[GameAttribute.Hitpoints_Cur] = 4.546875f;

            this.Attributes[GameAttribute.Level] = 1;
        }
开发者ID:elitepilot,项目名称:mooege,代码行数:25,代码来源:Living.cs


示例5: TranslateDirection2D

 public static Vector3D TranslateDirection2D(Vector3D source, Vector3D destination, Vector3D point, float amount)
 {
     Vector3D norm = Normalize(new Vector3D(destination.X - source.X, destination.Y - source.Y, 0f));
     return new Vector3D(point.X + norm.X * amount,
                         point.Y + norm.Y * amount,
                         point.Z);
 }
开发者ID:God601,项目名称:mooege,代码行数:7,代码来源:PowerMath.cs


示例6: Parse

 public override void Parse(GameBitBuffer buffer)
 {
     ActorId = buffer.ReadInt(32);
     if (buffer.ReadBool())
     {
         Position = new Vector3D();
         Position.Parse(buffer);
     }
     if (buffer.ReadBool())
     {
         Angle = buffer.ReadFloat32();
     }
     if (buffer.ReadBool())
     {
         TurnImmediately = buffer.ReadBool();
     }
     if (buffer.ReadBool())
     {
         Speed = buffer.ReadFloat32();
     }
     if (buffer.ReadBool())
     {
         Field5 = buffer.ReadInt(25);
     }
     if (buffer.ReadBool())
     {
         AnimationTag = buffer.ReadInt(21) + (-1);
     }
     if (buffer.ReadBool())
     {
         Field7 = buffer.ReadInt(32);
     }
 }
开发者ID:CommunityX,项目名称:mooege,代码行数:33,代码来源:ACDTranslateNormalMessage.cs


示例7: Parse

 /// <summary>
 /// Reads PRTransform from given GameBitBuffer.
 /// </summary>
 /// <param name="buffer">The GameBitBuffer to parse from.</param>
 public void Parse(GameBitBuffer buffer)
 {
     Quaternion = new Quaternion();
     Quaternion.Parse(buffer);
     Vector3D = new Vector3D();
     Vector3D.Parse(buffer);
 }
开发者ID:loonbg,项目名称:mooege,代码行数:11,代码来源:PRTransform.cs


示例8: Vendor

 public Vendor(World world, int actorSNO, Vector3D position, Dictionary<int, TagMapEntry> tags)
     : base(world, actorSNO, position, tags)
 {
     this.Attributes[GameAttribute.MinimapActive] = true;
     _vendorGrid = new InventoryGrid(this, 1, 20, (int) EquipmentSlotId.Vendor);
     PopulateItems();
 }
开发者ID:fengjz1,项目名称:mooege,代码行数:7,代码来源:Vendor.cs


示例9: RunPower

        public bool RunPower(Actor user, PowerScript power, Actor target = null,
                             Vector3D targetPosition = null, TargetMessage targetMessage = null)
        {
            // replace power with existing channel instance if one exists
            if (power is ChanneledSkill)
            {
                var existingChannel = _FindChannelingSkill(user, power.PowerSNO);
                if (existingChannel != null)
                {
                    power = existingChannel;
                }
                else  // new channeled skill, add it to the list
                {
                    _channeledSkills.Add((ChanneledSkill)power);
                }
            }

            // copy in context params
            power.User = user;
            power.Target = target;
            power.World = user.World;
            power.TargetPosition = targetPosition;
            power.TargetMessage = targetMessage;

            _StartScript(power);
            return true;
        }
开发者ID:loonbg,项目名称:mooege,代码行数:27,代码来源:PowerManager.cs


示例10: InFrontPostion

 protected void InFrontPostion() // spawn actor in front of user
 {
     float userFacing = (float)Math.Acos(this.User.RotationW) * 2f;
     this.SpawnPosition = new Vector3D(User.Position.X + 8 * (float)Math.Cos(userFacing),
                                      User.Position.Y + 8 * (float)Math.Sin(userFacing),
                                      User.Position.Z);
 }
开发者ID:loonbg,项目名称:mooege,代码行数:7,代码来源:SummoningSkills.cs


示例11: Projectile

        private bool _spawned;  // using my own spawn flag cause Actor.Spawned isn't being used right now

        public Projectile(PowerContext context, int actorSNO, Vector3D position)
            : base(context.World, actorSNO)
        {
            this.Field2 = 0x8;
            this.Field7 = 0x00000001;  // TODO: test if this is necessary

            if (this.Scale == 0f)
                this.Scale = 1.00f;

            this.Context = context;
            this.Position = new Vector3D(position);
            // offset position by mpq collision data
            this.Position.Z += this.ActorData.Cylinder.Ax1 - this.ActorData.Cylinder.Position.Z;
            // 2 second default timeout for projectiles
            this.Timeout = new SecondsTickTimer(context.World.Game, 2f);

            // copy in important effect params from user
            this.Attributes[GameAttribute.Rune_A, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_A, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_B, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_B, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_C, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_C, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_D, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_D, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_E, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_E, context.PowerSNO];

            _prevUpdatePosition = null;
            _mover = new ActorMover(this);
            _spawned = false;
        }
开发者ID:RC1140,项目名称:mooege,代码行数:29,代码来源:Projectile.cs


示例12: Create

        public static Actor Create(World world, int snoId, Vector3D position, TagMap tagMap)
        {
            if (!MPQStorage.Data.Assets[SNOGroup.Actor].ContainsKey(snoId))
                return null;

            var actorAsset = MPQStorage.Data.Assets[SNOGroup.Actor][snoId];            
            var actorData = actorAsset.Data as Mooege.Common.MPQ.FileFormats.Actor;
            if (actorData == null) return null;

            if (actorData.Type == ActorType.Invalid) 
                return null;

            // read tagMapEntries and put them into a dictionary
            var tags = tagMap.TagMapEntries.ToDictionary(entry => entry.Int1);

            // see if we have an implementation for actor.
            if (SNOHandlers.ContainsKey(snoId))
                return (Actor) Activator.CreateInstance(SNOHandlers[snoId], new object[] {world, snoId, position, tags});
           
            switch (actorData.Type)
            {
                case ActorType.Monster:
                    return new Monster(world, snoId, position, tags);
                case ActorType.Gizmo:
                    return CreateGizmo(world, snoId, position, tags);

            }

            return null;
        }
开发者ID:elitepilot,项目名称:mooege,代码行数:30,代码来源:ActorFactory.cs


示例13: CreateGizmo

        private static Actor CreateGizmo(World world, int snoId, Vector3D position, Dictionary<int,TagMapEntry> tags)
        {
            if (tags.ContainsKey((int)MarkerTagTypes.DestinationWorld))
                return new Portal(world, snoId, position, tags);

            return new Gizmo(world, snoId, position, tags);
        }
开发者ID:elitepilot,项目名称:mooege,代码行数:7,代码来源:ActorFactory.cs


示例14: Spawn

        public void Spawn(float facingAngle = 0)
        {
            FacingAngle = (float)Math.Cos(facingAngle / 2f);
            RotationAxis = new Vector3D(0, 0, (float)Math.Sin(facingAngle / 2f));

            this.World.Enter(this);
        }
开发者ID:n3rus,项目名称:mooege,代码行数:7,代码来源:EffectActor.cs


示例15: GetFacingAngle

        /// <summary>
        /// Returns 2D angle to face the target position.
        /// </summary>
        /// <param name="lookerPosition">The looker.</param>
        /// <param name="targetPosition">The target.</param>
        /// <returns></returns>
        public static float GetFacingAngle(Vector3D lookerPosition, Vector3D targetPosition)
        {
            if ((lookerPosition == null) || (targetPosition == null))
                return 0f;

            return (float) Math.Atan2((targetPosition.Y - lookerPosition.Y), (targetPosition.X - lookerPosition.X));
        }
开发者ID:ncoop23,项目名称:mooege,代码行数:13,代码来源:ActorHelpers.cs


示例16: GetMovementPosition

        public static Vector3D GetMovementPosition(Vector3D position, float speed, float facingAngle, int ticks = 6)
        {
            var xDelta = (speed * ticks) * (float)Math.Cos(facingAngle);
            var yDelta = (speed * ticks) * (float)Math.Sin(facingAngle);

            return new Vector3D(position.X + xDelta, position.Y + yDelta, position.Z);
        }
开发者ID:Vallenhael,项目名称:mooege,代码行数:7,代码来源:MovementHelpers.cs


示例17: WorldObject

 protected WorldObject(World world, uint dynamicID)
     : base(dynamicID)
 {
     this._world = world; // Specifically avoid calling the potentially overridden setter for this.World /komiga.
     this._world.Game.StartTracking(this);
     this._rotationAxis = new Vector3D();
     this._position = new Vector3D();
 }
开发者ID:elitepilot,项目名称:mooege,代码行数:8,代码来源:WorldObject.cs


示例18: MoveToPointWithPathfindAction

        public MoveToPointWithPathfindAction(Actor owner, Vector3D heading)
            : base(owner)
        {
            // Sending a request for a Path to the Pathing thread.
            _pathRequestTask = owner.World.Game.Pathfinder.GetPath(owner, owner.Position, heading);
            this.Heading = heading;

        }
开发者ID:loonbg,项目名称:mooege,代码行数:8,代码来源:MoveToPointWithPathfindAction.cs


示例19: Parse

 public override void Parse(GameBitBuffer buffer)
 {
     Field0 = buffer.ReadInt(32);
     Field1 = new Vector3D();
     Field1.Parse(buffer);
     Field2 = new Vector3D();
     Field2.Parse(buffer);
 }
开发者ID:loonbg,项目名称:mooege,代码行数:8,代码来源:ACDTranslateFixedUpdateMessage.cs


示例20: GetPath

 //This submits a request for a path to the pathfinder thread. This is the main point of entry for usage. - DarkLotus
 public PathRequestTask GetPath(Actor owner, Vector3D vector3D, Vector3D heading)
 {
     if (aipather == null)
         aipather = new Pathfinder();
     var pathRequestTask = new PathRequestTask(aipather, owner, owner.Position, heading);
     _queuedPathTasks.TryAdd(owner.DynamicID, pathRequestTask);
     return pathRequestTask;
 }
开发者ID:vrobel,项目名称:mooege,代码行数:9,代码来源:Pathfinder.cs



注:本文中的Mooege.Core.GS.Common.Types.Math.Vector3D类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Map.World类代码示例发布时间:2022-05-26
下一篇:
C# Actors.Actor类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap