How to change friction on a rigidbody

Post Reply
jorrit
Posts: 13
Joined: Mon Jul 18, 2005 7:16 am
Contact:

How to change friction on a rigidbody

Post by jorrit »

Hi all,

You can set friction on a rigid body in the constructor but I see no way to change it later at runtime. Is this possible?

Greetings,
jorrit
Posts: 13
Joined: Mon Jul 18, 2005 7:16 am
Contact:

Re: How to change friction on a rigidbody

Post by jorrit »

Ah apparently there is a setFriction() but it isn't mentioned in the doxygen documentation on the site. Where can I find more up-to-date documentation btw? I also noticed that for example btSphereShape isn't mentioned in that online documentation.

Greetings,
Blairvoyant
Posts: 11
Joined: Fri Nov 02, 2007 7:08 am

Re: How to change friction on a rigidbody

Post by Blairvoyant »

I don't know what kind of editor you're using, but personally I just use MSVC's 'go to definition' and 'find all references' features.. barring that, the header files are pretty clean and straightforward. I gave up on the doxygen a while ago :P
jorrit
Posts: 13
Joined: Mon Jul 18, 2005 7:16 am
Contact:

Re: How to change friction on a rigidbody

Post by jorrit »

Blairvoyant wrote:I don't know what kind of editor you're using, but personally I just use MSVC's 'go to definition' and 'find all references' features.. barring that, the header files are pretty clean and straightforward. I gave up on the doxygen a while ago :P
I use vi. I don't have MSVC and also MSVC doesn't work very well on linux.

Greetings,
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: How to change friction on a rigidbody

Post by Erwin Coumans »

Here is a link to the latest zipfile containing Bullet 2.64 API doxygen html documentation, also available in CHM html help format. You can also generate this locally, by running doxygen in the Bullet root directory.

Note that there is some issue with doxygen, it doesn't include classes/structures in Bullet that use this alignment macro:

Code: Select all

ATTRIBUTE_ALIGNED16(class) btSphereShape : public btConvexInternalShape
{
setFriction and so on should be documented in the Bullet user manual, I'm working on it.
Hope this helps,
Erwin
dss
Posts: 1
Joined: Fri Jan 11, 2008 4:12 pm

Re: How to change friction on a rigidbody

Post by dss »

The attached patch will configure Doxygen to ignore the ATTRIBUTE_ALIGNED16 macro.
Attachments
doxygen-ignore-aligned16.patch.gz
Upload form doesn't seem to allow .diff/.patch/.txt file extensions...
(572 Bytes) Downloaded 265 times
jamesfolk1
Posts: 3
Joined: Thu Jun 25, 2015 1:25 am

Re: How to change friction on a rigidbody

Post by jamesfolk1 »

Hello! How would you apply the patch to oxygen?

I received these errors when I applied the patch to the root directory of doxygen...

$ patch < doxygen-ignore-aligned16.patch
patching file Doxyfile
Hunk #1 FAILED at 583.
Hunk #2 FAILED at 615.
2 out of 2 hunks FAILED -- saving rejects to file Doxyfile.rej

$ cat Doxyfile.rej
***************
*** 583,595 ****
# compilation will be performed. Macro expansion can be done in a controlled
# way by setting EXPAND_ONLY_PREDEF to YES.

- MACRO_EXPANSION = NO

# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
# then the macro expansion is limited to the macros specified with the
# PREDEFINED and EXPAND_AS_PREDEFINED tags.

- EXPAND_ONLY_PREDEF = NO

# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
# in the INCLUDE_PATH (see below) will be search if a #include is found.
--- 583,595 ----
# compilation will be performed. Macro expansion can be done in a controlled
# way by setting EXPAND_ONLY_PREDEF to YES.

+ MACRO_EXPANSION = YES

# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
# then the macro expansion is limited to the macros specified with the
# PREDEFINED and EXPAND_AS_PREDEFINED tags.

+ EXPAND_ONLY_PREDEF = YES

# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
# in the INCLUDE_PATH (see below) will be search if a #include is found.
***************
*** 615,621 ****
# or name=definition (no spaces). If the definition and the = are
# omitted =1 is assumed.

- PREDEFINED =

# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
--- 615,621 ----
# or name=definition (no spaces). If the definition and the = are
# omitted =1 is assumed.

+ PREDEFINED = ATTRIBUTE_ALIGNED16(type)=type

# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
jamesfolk1
Posts: 3
Joined: Thu Jun 25, 2015 1:25 am

Re: How to change friction on a rigidbody

Post by jamesfolk1 »

Sorry. just realized how patch files work..
This patch was for the Doxyfile.
So where you have your Doxyfile you run..

$ patch < doxygen-ignore-aligned16.patch
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: How to change friction on a rigidbody

Post by drleviathan »

jorrit, I assume you're actually using Vim instead of Vi. There are plugins for Vim that would allow you to jump to function definitions and implementations, much like some of the shortcuts in an IDE. Finding these plugins and figuring out how they work is left as an exercise for the reader.

Personally, I use bash aliases and scripts that combine various commands (such as find and grep) to scan the code and then just navigate to the relevant files using a variety of Vim tricks (such as gf or some custom commands defined in my .vimrc).
Post Reply