BGE: Makes distance and angle python attributes for Radar Sensor writables
AbandonedPublic

Authored by Jorge Bernal (lordloki) on Dec 22 2014, 7:11 PM.

Details

Summary

This patch adds the posibility to modify the radar cone's distance and angle attributes during the runtime through BGE python.

A example can be found here:

Credit for this patch goes to @Kseniya Halezova (blenderprowlee) (Kseniya Halezova) also.

Diff Detail

Repository
rB Blender
Branch
bge-patch-radarsensor-distance
Jorge Bernal (lordloki) retitled this revision from to BGE: Makes distance python attribute for Radar Sensor writable.Dec 22 2014, 7:11 PM
Jorge Bernal (lordloki) updated this object.
Mitchell Stokes (moguri) requested changes to this revision.Dec 24 2014, 3:40 AM

I really don't like the idea of modifying Bullet code. If this absolutely has to be done, we should make sure that:

  1. The patch is submitted upstream
  2. Add a patch to extern/bullet2/patches so we can re-apply the patch after a Bullet update.

Also, there may be a better place to pull in FLT_MAX from (possibly a BLI header).

This revision now requires changes to proceed.Dec 24 2014, 3:40 AM
  • replace float.h by MT_Scalar.h for FLT_MAX define

I have added setheight patch in the bullet patch directory for futher updates.

Also, I uploaded the patch over bullet github repository: https://github.com/bulletphysics/bullet3/issues/304

It wasn't possible to do a pull request over bullet sources because it seems that under current bullet3 a collision cone shape doesn't exit even.

Taking this into account I don't know if this change in our bullet sources will be acceptable

Seems useful but would really want Bullet guys to have the patch applied first. The reason for that is we shouldn't lock ourselves into situation when stuff we need for new functionality is not in an upstream version of library and needs constant backporting.

What is also bad with this patch is that it'll break compilation with system bullet which is bad thing to do.

Campbell Barton (campbellbarton) requested changes to this revision.Feb 4 2015, 6:46 PM

Setting to require changes, until we have feedback from bullet project.

This revision now requires changes to proceed.Feb 4 2015, 6:46 PM

No news from bullet part since May. If we don't have feedback "soon", could we modify our bullet sources?
I think it is a tiny change and we could backport between bullet versions without any problem.

  • Now the cone angle can be modified too
  • Update patch and readme.txt accordingly
Jorge Bernal (lordloki) retitled this revision from BGE: Makes distance python attribute for Radar Sensor writable to BGE: Makes distance and angle python attribute for Radar Sensor writable.Oct 18 2015, 5:24 PM
Jorge Bernal (lordloki) updated this object.
Jorge Bernal (lordloki) retitled this revision from BGE: Makes distance and angle python attribute for Radar Sensor writable to BGE: Makes distance and angle python attributes for Radar Sensor writables.

API documentation changes are missing.

source/gameengine/Ketsji/KX_RadarSensor.cpp
235

Asterisk positions are wrong.
KX_RadarSensor *self = static_cast<KX_RadarSensor *>(self_v);

239

I think "an float" is wrong. --> expected a float value.

source/gameengine/Physics/Bullet/CcdPhysicsController.h
702

Asterisk position is wrong.
btConeShape *coneShape = static_cast<btConeShape *>(m_collisionShape);

711

Asterisk position is wrong. Same as above.

Jorge Bernal (lordloki) updated this object.
  • HG1's requested changes are implemented now

API documentation changes are missing.

There is no need to modify API documentation as both attributes were marked as read-write before.

Closing. Changes to bullet were committed for current bullet release. I will work on it after UPBGE merge.
Thanks for reviewing