• 请不要在回答技术问题时复制粘贴 AI 生成的内容
vincentjie
V2EX  ›  程序员

有个 Box2D 的问题想请教大家。

  •  
  •   vincentjie · Oct 10, 2015 · 1977 views
    This topic created in 3869 days ago, the information mentioned may be changed or developed.

    最近在写一个游戏的编辑器,发现别人使用 Box2D 时,对物体赋予线性速度后,其运动方向是基于刚体本身的方向的。但是我使用了 setLinearVelocity & setAngularVelocity 对刚体进行设置后,物体的运动方向却是一直基于世界坐标系的。

    举个栗子🌰

    对物体 A 使用 setLinearVelocity 设定运动方向为(10,0),角速度为 10 ,我希望 A 一边旋转一边往它自己的 x 轴正方向运动,运动轨迹是一条弧线。

    但实际上它只会旋转着,平行地往右运动。

    请问我应该怎么做呢?

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4294 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 05:18 · PVG 13:18 · LAX 22:18 · JFK 01:18
    ♥ Do have faith in what you're doing.