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

C# FullBodyBipedEffector类代码示例

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

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



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

示例1: InverseTransformEffector

			// Placing an effector so that an arbitrary Transform (target) ends up at targetPosition
			private void InverseTransformEffector(FullBodyBipedEffector effector, Transform target, Vector3 targetPosition, float weight) {
				// Direction from the target to the effector
				Vector3 toEffector = ik.solver.GetEffector(effector).bone.position - target.position;

				// Positioning the effector
				ik.solver.GetEffector(effector).position = Vector3.Lerp(ik.solver.GetEffector(effector).bone.position, targetPosition + toEffector, weight);
			}
开发者ID:paulkelly,项目名称:GGJ2016,代码行数:8,代码来源:KissingRig.cs


示例2: OnInteractionFinish

 private void OnInteractionFinish(
     FullBodyBipedEffector effector,
     InteractionObject obj)
 {
     if (this.finish == null)
         this.finish = new Dictionary<FullBodyBipedEffector, bool>();
     if (this.finish.ContainsKey(effector))
         this.finish[effector] = true;
 }
开发者ID:fgeraci,项目名称:CS195-Core,代码行数:9,代码来源:CharacterMecanim.cs


示例3: OnInteractionTrigger

 private void OnInteractionTrigger(
     FullBodyBipedEffector effector, 
     InteractionObject obj)
 {
     if (this.triggers == null)
         this.triggers = new Dictionary<FullBodyBipedEffector, bool>();
     if (this.triggers.ContainsKey(effector))
         this.triggers[effector] = true;
 }
开发者ID:fgeraci,项目名称:CS195-Core,代码行数:9,代码来源:CharacterMecanim.cs


示例4: OnStart

		// Called by the InteractionSystem when an interaction starts
		private void OnStart(FullBodyBipedEffector effectorType, InteractionObject interactionObject) {
			if (effectorType != FullBodyBipedEffector.LeftHand) return;
			if (interactionObject != obj) return;
			
			// Rotate the pivot of the hand targets
			RotatePivot();

			// Rotate the hold point so it matches the current rotation of the object
			holdPoint.rotation = obj.transform.rotation;
		}
开发者ID:cupsster,项目名称:ExtremeBusiness,代码行数:11,代码来源:PickUp2Handed.cs


示例5: IsInInteraction

		/// <summary>
		/// Determines whether this effector is interaction and not paused
		/// </summary>
		public bool IsInInteraction(FullBodyBipedEffector effectorType) {
			if (!IsValid(true)) return false;

			for (int i = 0; i < interactionEffectors.Length; i++) {
				if (interactionEffectors[i].effectorType == effectorType) {
					return interactionEffectors[i].inInteraction && !interactionEffectors[i].isPaused;
				}
			}
			return false;
		}
开发者ID:Alx666,项目名称:ProjectPhoenix,代码行数:13,代码来源:InteractionSystem.cs


示例6: OnDrop

        // Called by the InteractionSystem when an interaction is resumed from being paused
        private void OnDrop(FullBodyBipedEffector effectorType, InteractionObject interactionObject)
        {
            if (effectorType != FullBodyBipedEffector.LeftHand) return;

            // Make the box independent of the character
            box.transform.parent = null;

            // Turn on physics for the box
            if (box.GetComponent<Rigidbody>() != null) box.GetComponent<Rigidbody>().isKinematic = false;
        }
开发者ID:CG-F15-8-Rutgers,项目名称:UnityProjects,代码行数:11,代码来源:PickUpBox.cs


示例7: OnPause

		// Called by the InteractionSystem when an interaction is paused (on trigger)
		private void OnPause(FullBodyBipedEffector effectorType, InteractionObject interactionObject) {
			if (effectorType != FullBodyBipedEffector.LeftHand) return;
			if (interactionObject != obj) return;

			// Make the object inherit the character's movement
			obj.transform.parent = interactionSystem.transform;
			
			// Make the object kinematic
			var r = obj.GetComponent<Rigidbody>();
			if (r != null) r.isKinematic = true;

			// Set object pick up position and rotation to current
			pickUpPosition = obj.transform.position;
			pickUpRotation = obj.transform.rotation;
			holdWeight = 0f;
			holdWeightVel = 0f;
		}
开发者ID:cupsster,项目名称:ExtremeBusiness,代码行数:18,代码来源:PickUp2Handed.cs


示例8: Apply

        // Applies the weight curves and multipliers to the FBBIK solver
        public void Apply(IKSolverFullBodyBiped solver, FullBodyBipedEffector effector, InteractionTarget target, float timer, float weight)
        {
            for (int i = 0; i < weightCurves.Length; i++) {
                float mlp = target == null? 1f: target.GetValue(weightCurves[i].type);

                Apply(solver, effector, weightCurves[i].type, weightCurves[i].GetValue(timer), weight * mlp);
            }

            for (int i = 0; i < multipliers.Length; i++) {
                if (multipliers[i].curve == multipliers[i].result) {
                    if (!Warning.logged) Warning.Log("InteractionObject Multiplier 'Curve' " + multipliers[i].curve.ToString() + "and 'Result' are the same.", transform);
                }

                int curveIndex = GetWeightCurveIndex(multipliers[i].curve);

                if (curveIndex != -1) {
                    float mlp = target == null? 1f: target.GetValue(multipliers[i].result);

                    Apply(solver, effector, multipliers[i].result, multipliers[i].GetValue(weightCurves[curveIndex], timer), weight * mlp);
                } else {
                    if (!Warning.logged) Warning.Log("InteractionObject Multiplier curve " + multipliers[i].curve.ToString() + "does not exist.", transform);
                }
            }
        }
开发者ID:nickgirardo,项目名称:KADAPT,代码行数:25,代码来源:InteractionObject.cs


示例9: OnInteractionResume

 private void OnInteractionResume(
     CrossfadeInteractionHandler handler,
     FullBodyBipedEffector effectorType,
     InteractionObject interactionObject)
 {
     if (this.BodyResume != null)
         this.BodyResume(effectorType, interactionObject);
 }
开发者ID:CG-F15-20-Rutgers,项目名称:UnityProjects,代码行数:8,代码来源:IKController.cs


示例10: GetLimbMapping

		/// <summary>
		/// Gets the limb mapping for the effector type.
		/// </summary>
		public IKMappingLimb GetLimbMapping(FullBodyBipedEffector effector) {
			switch(effector) {
			case FullBodyBipedEffector.LeftShoulder: return limbMappings[0];
			case FullBodyBipedEffector.RightShoulder: return limbMappings[1];
			case FullBodyBipedEffector.LeftThigh: return limbMappings[2];
			case FullBodyBipedEffector.RightThigh: return limbMappings[3];
			case FullBodyBipedEffector.LeftHand: return limbMappings[0];
			case FullBodyBipedEffector.RightHand: return limbMappings[1];
			case FullBodyBipedEffector.LeftFoot: return limbMappings[2];
			case FullBodyBipedEffector.RightFoot: return limbMappings[3];
			default: return null;
			}
		}
开发者ID:Alx666,项目名称:ProjectPhoenix,代码行数:16,代码来源:IKSolverFullBodyBiped.cs


示例11: OnInteractionRelease

 private void OnInteractionRelease(
     FullBodyBipedEffector effectorType,
     InteractionObject interactionObject)
 {
     if (this.InteractionRelease != null)
         this.InteractionRelease(effectorType, interactionObject);
 }
开发者ID:fgeraci,项目名称:CS195-Core,代码行数:7,代码来源:BodyMecanim.cs


示例12: GetInteractionObject

        /// <summary>
        /// Gets the current interaction object of an effector.
        /// </summary>
        public InteractionObject GetInteractionObject(FullBodyBipedEffector effectorType)
        {
            if (!IsValid(true)) return null;

            for (int i = 0; i < interactionEffectors.Length; i++) {
                if (interactionEffectors[i].effectorType == effectorType) {
                    return interactionEffectors[i].interactionObject;
                }
            }
            return null;
        }
开发者ID:nickgirardo,项目名称:KADAPT,代码行数:14,代码来源:InteractionSystem.cs


示例13: StopInteraction

        /// <summary>
        /// Stops the interaction of an effector.
        /// </summary>
        public void StopInteraction(FullBodyBipedEffector effectorType)
        {
            if (!IsValid(true)) return;

            for (int i = 0; i < interactionEffectors.Length; i++) {
                if (interactionEffectors[i].effectorType == effectorType) interactionEffectors[i].Stop();
            }
        }
开发者ID:nickgirardo,项目名称:KADAPT,代码行数:11,代码来源:InteractionSystem.cs


示例14: OnInteractionStop

			// Called by the interaction system
			private void OnInteractionStop(FullBodyBipedEffector effectorType, InteractionObject interactionObject) {
				if (effectorType != this.effectorType || interactionObject != this.interactionObject) return;
				
				inTouch = false;
			}
开发者ID:cupsster,项目名称:ExtremeBusiness,代码行数:6,代码来源:TouchWalls.cs


示例15: Apply

		// Apply the curve to the specified solver, effector, with the value and weight.
		private void Apply(IKSolverFullBodyBiped solver, FullBodyBipedEffector effector, WeightCurve.Type type, float value, float weight) {
			switch(type) {
			case WeightCurve.Type.PositionWeight:
				solver.GetEffector(effector).positionWeight = Mathf.Lerp(solver.GetEffector(effector).positionWeight, value, weight);
				return;
			case WeightCurve.Type.RotationWeight:
				solver.GetEffector(effector).rotationWeight = Mathf.Lerp(solver.GetEffector(effector).rotationWeight, value, weight);
				return;
			case WeightCurve.Type.PositionOffsetX:
				solver.GetEffector(effector).position += (positionOffsetSpace != null? positionOffsetSpace.rotation: solver.GetRoot().rotation) * Vector3.right * value * weight;
				return;
			case WeightCurve.Type.PositionOffsetY:
				solver.GetEffector(effector).position += (positionOffsetSpace != null? positionOffsetSpace.rotation: solver.GetRoot().rotation) * Vector3.up * value * weight;
				return;
			case WeightCurve.Type.PositionOffsetZ:
				solver.GetEffector(effector).position += (positionOffsetSpace != null? positionOffsetSpace.rotation: solver.GetRoot().rotation) * Vector3.forward * value * weight;
				return;
			case WeightCurve.Type.Pull:
				solver.GetChain(effector).pull = Mathf.Lerp(solver.GetChain(effector).pull, value, weight);
				return;
			case WeightCurve.Type.Reach:
				solver.GetChain(effector).reach = Mathf.Lerp(solver.GetChain(effector).reach, value, weight);
				return;
			case WeightCurve.Type.Push:
				solver.GetChain(effector).push = Mathf.Lerp(solver.GetChain(effector).push, value, weight);
				return;
			case WeightCurve.Type.PushParent:
				solver.GetChain(effector).pushParent = Mathf.Lerp(solver.GetChain(effector).pushParent, value, weight);
				return;
			}
		}
开发者ID:Kazetsukai,项目名称:DiabloCarbonara,代码行数:32,代码来源:InteractionObject.cs


示例16: ResumeInteraction

 public void ResumeInteraction(FullBodyBipedEffector effector)
 {
     if (this.state == BodyIKState.Online
         || this.state == BodyIKState.Swapping)
     {
         // TODO: What if we swap immediately after? The interaction
         //       will get stuck at the trigger again.
         this.handlerPrimary.ResumeInteraction(effector);
     }
 }
开发者ID:CG-F15-20-Rutgers,项目名称:UnityProjects,代码行数:10,代码来源:IKController.cs


示例17: StopInteraction

        public void StopInteraction(FullBodyBipedEffector effector)
        {
            if (this.primaryEffectors.ContainsKey(effector) == true)
            {
                this.primaryEffectors.Remove(effector);
                this.handlerPrimary.StopInteraction(effector);

                // If this is our last active effector, shut down
                if (this.primaryEffectors.Count == 0)
                    this.state = BodyIKState.Stopping;
            }
        }
开发者ID:CG-F15-20-Rutgers,项目名称:UnityProjects,代码行数:12,代码来源:IKController.cs


示例18: StartInteraction

 public void StartInteraction(FullBodyBipedEffector effector, InteractionObject obj)
 {
     if (this.state == BodyIKState.Offline)
     {
         this.primaryEffectors.Add(effector, obj);
         this.handlerPrimary.StartInteraction(effector, obj, true);
         this.state = BodyIKState.Online;
     }
     else if (this.state == BodyIKState.Online
         || this.state == BodyIKState.Swapping)
     {
         // Is this effector already being used?
         if (this.primaryEffectors.ContainsKey(effector))
         {
             this.PerformSwap(effector, obj);
         }
         else
         {
             this.primaryEffectors.Add(effector, obj);
             this.handlerPrimary.StartInteraction(effector, obj, true);
         }
     }
     else if (this.state == BodyIKState.Stopping)
     {
         this.primaryEffectors.Add(effector, obj);
         this.handlerPrimary.StartInteraction(effector, obj, true);
         this.state = BodyIKState.Online;
     }
 }
开发者ID:CG-F15-20-Rutgers,项目名称:UnityProjects,代码行数:29,代码来源:IKController.cs


示例19: GetTarget

		// Returns the InteractionTarget of effector type and tag
		public Transform GetTarget(FullBodyBipedEffector effectorType, string tag) {
			if (tag == string.Empty || tag == "") return GetTarget(effectorType);
			
			for (int i = 0; i < targets.Length; i++) {
				if (targets[i].effectorType == effectorType && targets[i].tag == tag) return targets[i].transform;
			}

			return transform;
		}
开发者ID:Kazetsukai,项目名称:DiabloCarbonara,代码行数:10,代码来源:InteractionObject.cs


示例20: OnInteractionTrigger

 private void OnInteractionTrigger(
     CrossfadeInteractionHandler handler,
     FullBodyBipedEffector effectorType,
     InteractionObject interactionObject)
 {
     if (this.BodyTrigger != null)
         this.BodyTrigger(effectorType, interactionObject);
 }
开发者ID:CG-F15-20-Rutgers,项目名称:UnityProjects,代码行数:8,代码来源:IKController.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# FullComment类代码示例发布时间:2022-05-24
下一篇:
C# FtpClient类代码示例发布时间: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