Triangle mesh BGE character mode crash #40684

Closed
opened 2014-06-18 03:10:22 +02:00 by Joseph Masaki · 22 comments

System Information
MS Windows 7 Home Premium 64-bit SP1
NVIDIA GeForce GT 555M

Blender Version

Broken: 2.71 Release Candidate 2 a19c1be

Although it's been broken since at least 2.67.1 r57348

Short description of error
When object's collision bounds is set to triangle mesh and physics mode is set to character, blender will crash when object hits another.

Exact steps for others to reproduce the error
Change object collision bounds to triangle mesh
Start game engine

local_add_move_bug.blend
(File is from another bug)

**System Information** MS Windows 7 Home Premium 64-bit SP1 NVIDIA GeForce GT 555M **Blender Version** Broken: 2.71 Release Candidate 2 a19c1be Although it's been broken since at least 2.67.1 r57348 **Short description of error** When object's collision bounds is set to triangle mesh and physics mode is set to character, blender will crash when object hits another. **Exact steps for others to reproduce the error** Change object collision bounds to triangle mesh Start game engine [local_add_move_bug.blend](https://archive.blender.org/developer/F94600/local_add_move_bug.blend) (File is from another bug)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @JosephMasaki

Added subscriber: @JosephMasaki

#42084 was marked as duplicate of this issue

#42084 was marked as duplicate of this issue

#42363 was marked as duplicate of this issue

#42363 was marked as duplicate of this issue

#33151 was marked as duplicate of this issue

#33151 was marked as duplicate of this issue
Member

Added subscriber: @brita

Added subscriber: @brita

Added subscriber: @Psy-Fi

Added subscriber: @Psy-Fi

This is really the weirdest thing...the localGetSupportingVertexWithoutMargin should be defined for the triangleshape type that the offending variable is. I even have -fsanitize-address on and I haven't seen any error here.

However, a lead for you Ines might be that changing the physics type of the object from character to rigid body seems to bypass the problem. So maybe there's some initialization that is skipped here.

I suspect this might not be a blender bug, but you can see what happens differently between the two cases so you might at least somehow bypass this. I hope that helps even if a little.

This is really the weirdest thing...the localGetSupportingVertexWithoutMargin should be defined for the triangleshape type that the offending variable is. I even have -fsanitize-address on and I haven't seen any error here. However, a lead for you Ines might be that changing the physics type of the object from character to rigid body seems to bypass the problem. So maybe there's some initialization that is skipped here. I suspect this might not be a blender bug, but you can see what happens differently between the two cases so you might at least somehow bypass this. I hope that helps even if a little.

To avoid any misunderstanding - I haven't seen any error -before- the crash. I can confirm the crash too (This is on Ubuntu 64 bit)

To avoid any misunderstanding - I haven't seen any error -before- the crash. I can confirm the crash too (This is on Ubuntu 64 bit)

Added subscriber: @sreich

Added subscriber: @sreich

From a quick glance, the character controller needs a convex shape. This is either the main shape assigned, or a separate convex shape.
For the latter m_useGhostObjectSweepTest needs to be set to false.

At least one part of the bug is that we are casting the collision shape to a btConvexShape* in CcdPhysicsController::CreateCharacterController().

I'm not sure in what case you'd use a triangle mesh for characer controllers, maybe the best (and easiest) solution would be to disallow that completely.

As for adding a trimesh case in localGetSupportingVertexWithoutMargin(), that doesn't really make sense, for a convex shape ;)

From a quick glance, the character controller needs a convex shape. This is either the main shape assigned, or a separate convex shape. For the latter m_useGhostObjectSweepTest needs to be set to false. At least one part of the bug is that we are casting the collision shape to a btConvexShape* in CcdPhysicsController::CreateCharacterController(). I'm not sure in what case you'd use a triangle mesh for characer controllers, maybe the best (and easiest) solution would be to disallow that completely. As for adding a trimesh case in localGetSupportingVertexWithoutMargin(), that doesn't really make sense, for a convex shape ;)
Member

@sreich what to you suggest instead of casting the collision shape to a btConvexShape* ? both CcdPhysicsController::CreateCharacterController() and btKinematicCharacterController::btKinematicCharacterController that it is inheriting from receive a btConvexShape . Is that correct? Is this a problem even if we disallow triangle meshes?

@sreich what to you suggest instead of casting the collision shape to a btConvexShape* ? both CcdPhysicsController::CreateCharacterController() and btKinematicCharacterController::btKinematicCharacterController that it is inheriting from receive a btConvexShape . Is that correct? Is this a problem even if we disallow triangle meshes?

@brita the problem with the cast is that the shape can be non-convex, as a trimesh is. So we have to at least make sure that the shape is in fact convex before casting.

@brita the problem with the cast is that the shape can be non-convex, as a trimesh is. So we have to at least make sure that the shape is in fact convex before casting.
Member
Added subscribers: @hg1, @particleemitter, @AngusHollands-4, @kupoman
Member

◀ Merged tasks: #33151.

◀ Merged tasks: #33151.

Added subscribers: @sybrenstuvel, @JorgeBernalMartinez

Added subscribers: @sybrenstuvel, @JorgeBernalMartinez

Added subscriber: @pgi

Added subscriber: @pgi

If character is not supposed to have a triangle mesh shape, what about a fallback strategy, like the one used for character motion. Print a statement like that one:

"Character motion enabled on non-character object (Cube), falling back to simple motion."

and use the default shape. It can also be used as temporary patch.

If character is not supposed to have a triangle mesh shape, what about a fallback strategy, like the one used for character motion. Print a statement like that one: "Character motion enabled on non-character object (Cube), falling back to simple motion." and use the default shape. It can also be used as temporary patch.
Member

I think I couldn't really guess what would be the best shape fallback. The user should set it, I think. @sreich thoughts on this?

The idea is that on new files, users won't even have the option. On files that already have this combination it would be left untouched. I am unsure whether most users actually see the prints, so I think there would be cases where the option would be silently changed without the user noticing.

I think I couldn't really guess what would be the best shape fallback. The user should set it, I think. @sreich thoughts on this? The idea is that on new files, users won't even have the option. On files that already have this combination it would be left untouched. I am unsure whether most users actually see the prints, so I think there would be cases where the option would be silently changed without the user noticing.
Member

Added subscriber: @TimCrellin

Added subscriber: @TimCrellin
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Inês Almeida self-assigned this 2015-02-19 12:29:33 +01:00
Member

Closed with D984

Closed with [D984](https://archive.blender.org/developer/D984)
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
9 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#40684
No description provided.