python制作赛车3d游戏

本篇文章给大家谈谈如何用python制作游戏,以及利用python制作小游戏,希望对各位有所帮助,不要忘了收藏本站喔。

大家好,小编来为大家解答以下问题,如何用python制作游戏,利用python制作小游戏,现在让我们一起来看看吧!

2019独角兽企业重金招聘Python工程师标准>>> 

该组件是用来描述轮胎的(比如扭矩 转速等等),可用来附加在赛车游戏 的车轮上

A special collider for vehicle wheels.

Wheel collider is used to model vehicle wheels. It simulates a spring and damper suspension setup, and uses a slip based tire friction model to calculate wheel contact forces. Wheel's collision detection is performed by casting a ray from center downwards the local y-axis. The wheel has a radius and can extend downwards by suspensionDistance amount. The wheel is controlled with motorTorque, brakeTorque and steerAngle properties. Wheel collider computes friction separately from the rest of physics engine, using a slip based friction model. This allows for more realistic behaviour, but makes wheel colliders ignore standard PhysicMaterial settings. Simulation of different road materials is done by changing the forwardFriction and sidewaysFriction based on what material the wheel is hitting. See Also: GetGroundHit and WheelFrictionCurve.           -----------------------来自 Scripting API

3个  应用例子

1.通过扭矩来使车加速   

GetComponent<WheelCollider>().motorTorque = Input.GetAxis("Vertical") * 25000 * Time.deltaTime;

2.通过steer 来控制汽车转弯

float delta=  Input.GetAxis("Horizontal");
GetComponent<WheelCollider>().steerAngle = 20 * delta;

3.通过localRotation控制汽车转弯

float delta=  Input.GetAxis("Horizontal");
transform.localRotation = Quaternion.Euler(transform.localRotation.x, 30 * delta, 0);

转载于


原文地址:https://blog.csdn.net/2301_81896552/article/details/136696820

  • 5
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值