BGE Python - Ray sensor has wrong axis constants #40620

Closed
opened 2014-06-14 18:45:01 +02:00 by Thomas · 8 comments

System Information
Windows 7 32 Bit

Blender Version
Broken: 2.70a f93bc76, 2.69

Short description of error
Using a Ray sensor with Axis defined to "+X axis".
Reading out the axis with python gives the wrong number.
KX_RAY_AXIS_POS_X is 0
KX_RAY_AXIS_POS_Y is 1

With "+X axis" Python ray.axis gives 1
With "+Y axis" Python ray.axis gives 0

Similar bug:
https://developer.blender.org/T36503
but patch didn't fix the bug.

Looking for the defines for the cpp-files in:
blender/source/blender/makesdna/DNA_sensor_types.h:

shows:
/* raysensor->axisflag /
/
flip x and y to make y default!!! */

  • define SENS_RAY_X_AXIS 1
  • define SENS_RAY_Y_AXIS 0
  • define SENS_RAY_Z_AXIS 2
  • define SENS_RAY_NEG_X_AXIS 3
  • define SENS_RAY_NEG_Y_AXIS 4
  • define SENS_RAY_NEG_Z_AXIS 5

Btw:
Why is it called "KX_RAY_AXIS_POS_X" when it has nothing to do with positions?
I think "KX_RAY_X_AXIS" would be the better name.

bug_ray_sensor_axis.blend

**System Information** Windows 7 32 Bit **Blender Version** Broken: 2.70a f93bc76, 2.69 **Short description of error** Using a Ray sensor with Axis defined to "+X axis". Reading out the axis with python gives the wrong number. KX_RAY_AXIS_POS_X is 0 KX_RAY_AXIS_POS_Y is 1 With "+X axis" Python ray.axis gives 1 With "+Y axis" Python ray.axis gives 0 Similar bug: https://developer.blender.org/T36503 but patch didn't fix the bug. Looking for the defines for the cpp-files in: blender/source/blender/makesdna/DNA_sensor_types.h: shows: /* raysensor->axisflag */ /* flip x and y to make y default!!! */ - define SENS_RAY_X_AXIS 1 - define SENS_RAY_Y_AXIS 0 - define SENS_RAY_Z_AXIS 2 - define SENS_RAY_NEG_X_AXIS 3 - define SENS_RAY_NEG_Y_AXIS 4 - define SENS_RAY_NEG_Z_AXIS 5 Btw: Why is it called "KX_RAY_AXIS_POS_X" when it has nothing to do with positions? I think "KX_RAY_X_AXIS" would be the better name. [bug_ray_sensor_axis.blend](https://archive.blender.org/developer/F94241/bug_ray_sensor_axis.blend)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @Thomas_v2

Added subscriber: @Thomas_v2

Added subscriber: @mont29

Added subscriber: @mont29
Inês Almeida was assigned by Bastien Montagne 2014-06-15 20:43:35 +02:00

Added subscriber: @ideasman42

Added subscriber: @ideasman42

POS/NEG are fore positive/negative, but there is indeed still an issue here.

POS/NEG are fore positive/negative, but there is indeed still an issue here.

This issue was referenced by 8f30414c29

This issue was referenced by 8f30414c29bc62447bc6664d9395778cae027133

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit 8f30414c29.

Closed by commit 8f30414c29.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#40620
No description provided.