This repository was archived by the owner on Apr 25, 2026. It is now read-only.
How to add visual objects? #569
Unanswered
waleedbkhalid
asked this question in
General
Replies: 1 comment 4 replies
-
|
You can check the return type of addVisualSphere |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have declared a ball variable as:
raisim::Sphere*ball;
In the private section of my environment file.
Then in my constructor I do this:
ball = world_.addSphere(0.05, 2.0,"default" );
Then in my reset function I do this:
ball->setPosition(raisim::Vec<3>{goal_X_coordinate,goal_Y_coordinate,0});
ball->setLinearVelocity(raisim::Vec<3>{0,0,0});
ball->setBodyType(raisim::BodyType::STATIC);
The issue is, I only need a visual not an actual sphere.
So I went to the visual objects,
But I am not sure, how do I declare a visualSphere, then initialize it in constructor and then set its properties.
I have tried a few things and got type errors. Can you please provide guidance for this?
I dont want to do it using an auto pointer, as that pointer is not accessible in functions.
Secondly,
There is a visualHeightMap available, which takes in x and y range and the height vector corresponding to that.
My question is, is there a method similar to setPosition that sets the x and y range and height range. This functionality would help me edit the heightMap at the right position in my code.
Beta Was this translation helpful? Give feedback.
All reactions