-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
Nodes/VVVV.DX11.Nodes.Bullet/Core/Filters/IsYoungerRigidBodyFilter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using BulletSharp; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace VVVV.Bullet.Core.Filters | ||
{ | ||
public class IsYoungerRigidBodyFilter : IRigidBodyFilter | ||
{ | ||
public float MinimumAge = 0.0f; | ||
|
||
public bool Filter(RigidBody body) | ||
{ | ||
BodyCustomData data = (BodyCustomData)body.UserObject; | ||
return data.LifeTime <= MinimumAge; | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...s/VVVV.DX11.Nodes.Bullet/Nodes/Bodies/Rigid/Filters/YoungerThanThanRigidBodyFilterNode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.Composition; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using VVVV.Bullet.Core.Filters; | ||
using VVVV.PluginInterfaces.V2; | ||
|
||
namespace VVVV.Bullet.Nodes.Bodies.Rigid.Filters | ||
{ | ||
[PluginInfo(Name = "IsYoungerThan", Category = "Bullet", Version = "Rigid.Filter", Author = "vux", Help = "Filter interfact to check for a maximum age")] | ||
public class BulletYoungerThanRigidBodyFilter : IPluginEvaluate, IPartImportsSatisfiedNotification | ||
{ | ||
[Input("Age", IsSingle = true, DefaultValue = 1.0)] | ||
protected ISpread<float> age; | ||
|
||
[Output("Output", IsSingle = true)] | ||
protected ISpread<IsYoungerRigidBodyFilter> output; | ||
|
||
public void OnImportsSatisfied() | ||
{ | ||
this.output[0] = new IsYoungerRigidBodyFilter(); | ||
} | ||
|
||
public void Evaluate(int SpreadMax) | ||
{ | ||
this.output[0].MinimumAge = age[0]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule girlpower
updated
1 files
+749 −0 | nodes/plugins/bullet/IsYoungerThan (Bullet Rigid.Filter) help.v4p |