Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose 'angular_velocity ' as a public attribute in 'PropNode' for modding #771

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dhextras
Copy link

@dhextras dhextras commented Dec 27, 2024

Steps

  • Write a good description of what your PR does (and WHY it does it).
  • Add yourself to CONTRIBUTORS if you are a new contributor.
  • Add a CHANGELOG entry if your change is non-trivial.
  • Ensure make preflight completes successfully.

Description

Add support for custom angular velocity for prop nodes, providing greater control over bombs and similar objects. It enables smoother, more dynamic motion and expands possibilities for modding.

Usage Example
Below is a simple example to create a prop node with angular velocity & update it:

import bascenev1 as bs

# Create a node with a specified angular velocity
prop_node = bs.newnode(
    "prop",
    attrs={
        "position": (0, 1, 0),
        "angular_velocity": (0.5, 1.0, 0.3),  # Angular velocity (x, y, z)
        "body": "sphere",
        "mesh": bs.getmesh("bomb"),
        "color_texture": bs.gettexture("impact_lit"),
    },
)

# Change angular velocity
prop_node.angular_velocity = (0.3, 0, 0) 

For an extended example, check out the implementation I made in the B Day Plugin

Type of Changes

Type
✨ New feature

Copy link
Contributor

@EraOSBeta EraOSBeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally can't test this right now; but I think this won't cause any issues for backwards compatibility. I thank you in advance if this gets merged!

@dhextras
Copy link
Author

dhextras commented Jan 1, 2025

@EraOSBeta Appreciate that let's see if it gets merged

@Gnium-NFT Gnium-NFT mentioned this pull request Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants