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

C# Vec3类代码示例

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

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



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

示例1: SceneData

        public SceneData(Enigma.D3.Scene scene)
        {
            scene_id = scene.x000_Id;
            scene_sno_id = scene.x0E8_SceneSnoId;
            area_sno_id = scene.x018_LevelAreaSnoId;

            min = new Vec3(scene.x0FC_MeshMinX, scene.x100_MeshMinY, scene.x104_MeshMinZ);
            max = new Vec3(scene.x174_MeshMaxX, scene.x178_MeshMaxY, scene.x104_MeshMinZ); //there is no max z, so consider all grid cells flat
        }
开发者ID:InjectionDev,项目名称:Dev.D3,代码行数:9,代码来源:SceneData.cs


示例2: JetPackTick

		static void JetPackTick() {

			if (JetPackCtl) {
				float rotz = Mem.ReadFloat(ADDRESSES.DISPLAY.CAMERA_Z_ROT);
				var xVal = Math.Abs((float)Math.Cos(rotz)) * (rotz > 0 && rotz < HALF_PI || (rotz > (PI * 2 - HALF_PI) && rotz < PI * 2) ? -1 : 1);
				var yVal = Math.Abs((float)Math.Sin(rotz)) * (rotz > PI && rotz < PI * 2 ? 1 : -1);

				var coords = new Vec3(Mem.PtrToAddr(ADDRESSES.PLAYER.PlayerPointer, ADDRESSES.PLAYER.COORDS_X_OFFSET));
				coords.X += xVal * JetPackSpeed;
				coords.Y += yVal * JetPackSpeed;
				if ((bool)Config.jetPackCtlEnableZ.Value) {
					float rotx = Mem.ReadFloat(ADDRESSES.DISPLAY.CAMERA_X_ROT);
					coords.Z += rotx / HALF_PI * JetPackSpeed;
				}
				coords.MemWrite(Mem.PtrToAddr(ADDRESSES.PLAYER.PlayerPointer, ADDRESSES.PLAYER.COORDS_X_OFFSET));
			}

			new Vec3(0, 0, 0.0066016f).MemWrite(Mem.PtrToAddr(ADDRESSES.PLAYER.PlayerPointer, ADDRESSES.PLAYER.X_MOVE_SPEED));

			if (JetPackUp)
				Mem.WriteFloat(ADDRESSES.IsInVehicle	? Mem.PtrToAddr(ADDRESSES.VEHICLE.VehiclePointer, ADDRESSES.VEHICLE.SPEED_Z_OFFSET)
													: Mem.PtrToAddr(ADDRESSES.PLAYER.PlayerPointer, ADDRESSES.PLAYER.Z_MOVE_SPEED), JetPackSpeed * PI * 2);
			else if (JetPackDown)
				Mem.WriteFloat(ADDRESSES.IsInVehicle	? Mem.PtrToAddr(ADDRESSES.VEHICLE.VehiclePointer, ADDRESSES.VEHICLE.SPEED_Z_OFFSET)
													: Mem.PtrToAddr(ADDRESSES.PLAYER.PlayerPointer, ADDRESSES.PLAYER.Z_MOVE_SPEED), -JetPackSpeed * PI * 2);
		}
开发者ID:TETYYS,项目名称:VCTRNR,代码行数:26,代码来源:ModJetPack.cs


示例3: OnGetCameraTransform

        protected override void OnGetCameraTransform( out Vec3 position, out Vec3 forward,
			out Vec3 up, ref Degree cameraFov )
        {
            position = Vec3.Zero;
            forward = Vec3.XAxis;
            up = Vec3.ZAxis;

            Unit unit = GetPlayerUnit();
            if( unit == null )
                return;

            PlayerIntellect.Instance.FPSCamera = false;

            //To use data about orientation the camera if the cut scene is switched on
            if( IsCutSceneEnabled() )
            {
                if( CutSceneManager.Instance.GetCamera( out position, out forward, out up, out cameraFov ) )
                    return;
            }

            float distance = 25;
            position = unit.GetInterpolatedPosition() + new Vec3( 0, -distance, 0 );
            forward = Vec3.YAxis;
            up = Vec3.ZAxis;
        }
开发者ID:whztt07,项目名称:SDK,代码行数:25,代码来源:PlatformerDemoGameWindow.cs


示例4: Vertex

 public Vertex(Vec3 position, Vec3 normal, Vec2 texCoord, Vec3 tangent)
 {
     this.position = position;
     this.normal = normal;
     this.texCoord = texCoord;
     this.tangent = tangent;
 }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:7,代码来源:Decal.cs


示例5: AttackTask

 public AttackTask(Weapon weapon, Vec3 target)
 {
     this.taskTime = 0f;
     this.weapon = weapon;
     this.targetPosition = target;
     this.targetEntity = null;
 }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:7,代码来源:AKturretAI.cs


示例6: ExploreCell

 public ExploreCell(AABB aabb, List<Cell> cells, Vec3 position, int id = -1)
     : base(aabb.Min.X, aabb.Min.Y, 0, aabb.Max.X, aabb.Max.Y, 0, MovementFlag.None, id)
 {
     InitExploreCell();
     Position = position;
     Cells = cells;            
 }
开发者ID:InjectionDev,项目名称:Dev.D3,代码行数:7,代码来源:ExploreCell.cs


示例7: CellsContains2D

        public bool CellsContains2D(Vec3 p)
        {
            if (!Contains2D(p))
                return false;

            return Cells.Exists(c => c.Contains2D(p));
        }
开发者ID:InjectionDev,项目名称:Dev.D3,代码行数:7,代码来源:ExploreCell.cs


示例8: GetIllumination

 public override float GetIllumination( Vec3 position, Vec3 normal )
 {
     //normal
     float normalCoef = Vec3.Dot( normal, -lightDirection );
     MathFunctions.Saturate( ref normalCoef );
     return normalCoef;
 }
开发者ID:whztt07,项目名称:SDK,代码行数:7,代码来源:MyLight.cs


示例9: Initialize

        public static unsafe extern IntPtr Initialize(
			 ref Vec3 bmin, ref Vec3 bmax,
			 float tileSize, float cellSize, float cellHeight,
			 int minRegionSize, int mergeRegionSize, [MarshalAs( UnmanagedType.U1 )] bool monotonePartitioning,
			 float maxEgdeLength, float maxEdgeError,
			 int vertsPerPoly, float detailSampleDistance, float detailMaxSampleError,
			 float agentHeight, float agentRadius, float agentMaxClimb, float agentMaxSlope );
开发者ID:whztt07,项目名称:SDK,代码行数:7,代码来源:RecastNavigationSystem.cs


示例10: DirectionalLight

 public DirectionalLight(SceneGraph graph, Vec3 intensity, Vec3 direction, float maxShadowDepth)
     : base(graph)
 {
     Intensity = intensity;
     MaxShadowDepth = maxShadowDepth;
     Direction = direction.Normalized;
 }
开发者ID:johtela,项目名称:Compose3D,代码行数:7,代码来源:Lights.cs


示例11: Mat33

 public Mat33(float exx, float exy, float exz, float eyx, float eyy, float eyz, float ezx,
     float ezy, float ezz)
 {
     ex = new Vec3(exx, exy, exz);
     ey = new Vec3(eyx, eyy, eyz);
     ez = new Vec3(ezx, ezy, ezz);
 }
开发者ID:Nomad1,项目名称:sharpbox2d,代码行数:7,代码来源:Mat33.cs


示例12: TransformNode

 public TransformNode(SceneGraph graph, SceneNode node, Vec3 offset, Vec3 orientation, Vec3 scale)
     : base(graph, node)
 {
     _offset = offset;
     _orientation = orientation;
     _scale = scale;
     UpdateTransform ();
 }
开发者ID:johtela,项目名称:Compose3D,代码行数:8,代码来源:TransformNode.cs


示例13: myPositionCallback

 // Position callback
 public static void myPositionCallback(Object sender, TimeValue timestamp, Int32 sensor, Vec3 report)
 {
     Console.WriteLine("Got POSITION report: Position = ({0}, {1}, {2}), Sensor = ({3})",
         report.x,
         report.y,
         report.z,
         sensor);
 }
开发者ID:thomasgauthier,项目名称:Managed-OSVR,代码行数:9,代码来源:TrackerCallback.cs


示例14: GetCheckVisibilityRay

        public override Ray GetCheckVisibilityRay( Vec3 position )
        {
            Vec3 dataPosition = position - lightDirection * 10000.0f;

            Vec3 diff = position - dataPosition;
            Vec3 dir = diff.GetNormalize();
            return new Ray( dataPosition, diff - dir * .01f );
        }
开发者ID:whztt07,项目名称:SDK,代码行数:8,代码来源:MyLight.cs


示例15: SetForceFireRotationLookTo

        public void SetForceFireRotationLookTo( Vec3 lookTo )
        {
            setForceFireRotation = true;

            Vec3 diff = lookTo - Position;
            //Vec3 diff = lookTo - GetFirePosition( false );

            forceFireRotation = Quat.FromDirectionZAxisUp( diff );
        }
开发者ID:whztt07,项目名称:SDK,代码行数:9,代码来源:Weapon.cs


示例16: GetFirstPersonCameraPosition

 public override void GetFirstPersonCameraPosition( out Vec3 position, out Vec3 forward, out Vec3 up )
 {
     position = GetInterpolatedPosition() + Type.FPSCameraOffset * GetInterpolatedRotation();
     if( PlayerIntellect.Instance != null )
         forward = PlayerIntellect.Instance.LookDirection.GetVector();
     else
         forward = Vec3.XAxis;
     up = Vec3.ZAxis;
 }
开发者ID:whztt07,项目名称:SDK,代码行数:9,代码来源:Crane.cs


示例17: OnGetEditorSelectionByRay

 protected override bool OnGetEditorSelectionByRay( Ray ray, out Vec3 pos, ref float priority )
 {
     float scale1, scale2;
     bool ret = GetBox().RayIntersection( ray, out scale1, out scale2 );
     if( ret )
         pos = ray.GetPointOnRay( Math.Min( scale1, scale2 ) );
     else
         pos = Vec3.Zero;
     return ret;
 }
开发者ID:CITS4242B2010,项目名称:project2010,代码行数:10,代码来源:DynamicCollision.cs


示例18: SetMomentaryTurnToPosition

        public void SetMomentaryTurnToPosition( Vec3 pos )
        {
            if( ( pos - Position ).Length() < 4.0f )
            {
                Vec3 dir = ( pos - Position ).GetNormalize();
                pos += dir * 10;
            }

            MomentaryTurnToPositionUpdate( pos );
        }
开发者ID:DarrenHassan,项目名称:GDM4242-GroupD,代码行数:10,代码来源:Turret.cs


示例19: Push

 public void Push(Vec3 v)
 {
     if (!Entity.Local) {
         pushV += v;
     } else if (Entity.Model.Server != null) {
         Entity.Get<PositionComponent>().Position += v;
     } else {
         pushV += v;
     }
 }
开发者ID:kuviman,项目名称:QGame,代码行数:10,代码来源:Component.cs


示例20: PhysX_GetDriveVelocity

 public override void PhysX_GetDriveVelocity( out Vec3 linear, out Vec3 angular )
 {
     if( nativeJoint == IntPtr.Zero )
     {
         linear = Vec3.Zero;
         angular = Vec3.Zero;
         return;
     }
     PhysXNativeWrapper.PhysXNativeD6Joint.GetDriveVelocity( nativeJoint, out linear, out angular );
 }
开发者ID:whztt07,项目名称:SDK,代码行数:10,代码来源:PhysXUniversalJoint.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Vec3F类代码示例发布时间:2022-05-24
下一篇:
C# Vec2类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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