7
我有一個長方體,正在從一個45度的角度發射。身體也以45度角向上旋轉,並且我已經將質量設置在身體的前部。身體不旋轉,以重力面朝下
然而,身體在空氣中升起,因爲身體回落到地球它不旋轉。有沒有辦法讓質量一方首先下降?
我的現實世界的例子是,扔一個網球連接到空氣中的繩子。目前,當重力影響時,繩子不落在球后面。
這裏是我的「球」
Body = BodyFactory.CreateRectangle(world, ConvertUnits.ToSimUnits(texture.Width), ConvertUnits.ToSimUnits(texture.Height),100f, postition, this);
Body.Mass = 1;
Body.LocalCenter = new Vector2(ConvertUnits.ToSimUnits(Texture.Width), ConvertUnits.ToSimUnits(Texture.Height/2));
Body.UserData = this;
Body.BodyType = BodyType.Dynamic;
Body.CollisionCategories = Category.All;
Body.CollidesWith = Category.All;
Body.IgnoreGravity = false;
float ang = BarrelJoint.JointAngle;
Body.Rotation = ang;
然後,我這樣做是爲了火了:
Body.ApplyLinearImpulse(new Vector2((float)Math.Cos(ang) * 100, (float)Math.Sin(ang) * 100));
我猜有一些設置或計算我忘了。
如果您有空氣阻力,身體只會旋轉。我想你的模擬不能模擬大氣。 – phoog
@phoog使這個答案 –
你會如何去模擬在一個更古老的物理世界的氣氛? – Jastill