Exemple #1
0
        public IPhysical MakeCyllinder(double rbottom, double rtop, double height)
        {
            var body = new BEPUphysics.Entities.Prefabs.Cylinder(new Vector3(0, 0, 0),
                                                                 BepuConverter.ToSimUnits((float)height),
                                                                 BepuConverter.ToSimUnits((float)rbottom), 1);

            // в мир сразу не добавляем
            return(new BepuBody(body)
            {
                InitialOrientation = Quaternion.CreateFromYawPitchRoll(MathHelper.PiOver2, 0, 0)
            });
        }
Exemple #2
0
        public CharacterController GenCharCon()
        {
            // TODO: Better variable control! (Server should command every detail!)
            CharacterController cb = new CharacterController(GetPosition().ToBVector(), CBHHeight * 2f * mod_scale, CBHHeight * 1.1f * mod_scale,
                                                             CBHHeight * 1f * mod_scale, CBRadius * mod_scale, CBMargin, Mass, CBMaxTractionSlope, CBMaxSupportSlope, CBStandSpeed, CBCrouchSpeed, CBProneSpeed,
                                                             CBTractionForce * Mass, CBSlideSpeed, CBSlideForce * Mass, CBAirSpeed, CBAirForce * Mass, CBJumpSpeed, CBSlideJumpSpeed, CBGlueForce * Mass);

            cb.StanceManager.DesiredStance = Stance.Standing;
            cb.ViewDirection = new Vector3(1f, 0f, 0f);
            cb.Down          = new Vector3(0f, 0f, -1f);
            cb.Tag           = this;
            BEPUphysics.Entities.Prefabs.Cylinder tb = cb.Body;
            tb.Tag            = this;
            tb.AngularDamping = 1.0f;
            tb.CollisionInformation.CollisionRules.Group = CGroup;
            cb.StepManager.MaximumStepHeight             = CBStepHeight;
            cb.StepManager.MinimumDownStepHeight         = CBDownStepHeight;
            return(cb);
        }
Exemple #3
0
		public IPhysical MakeCyllinder(double rbottom, double rtop, double height)
		{
			var body = new BEPUphysics.Entities.Prefabs.Cylinder(new Vector3(0, 0, 0),
			                                                     BepuConverter.ToSimUnits((float)height),
			                                                     BepuConverter.ToSimUnits((float)rbottom), 1);
			// в мир сразу не добавляем
			return new BepuBody(body) {InitialOrientation = Quaternion.CreateFromYawPitchRoll(MathHelper.PiOver2, 0, 0)};
		}