2 registered members (AndrewAMD, SBGuy),
987
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
C# wrapper 2.3.0 - RELEASE
[Re: pararealist]
#376311
07/01/11 16:37
07/01/11 16:37
|
Joined: Dec 2002
Posts: 616 Austria
Stromausfall
OP
User
|
OP
User
Joined: Dec 2002
Posts: 616
Austria
|
a new version was uploaded (for Acknex 7.85.4 AND Acknex 8.20) the update of the wrapper includes: - updated to 8.20 - the wrapper can be used without the scheduler - using the Conditional compilation symbols (VS2010) value "NO_SCHEDULER" ("A7_WRAPPER" can be used beside "NO_SCHEDULER" !) here's the link: AcknexWrapper_2_3_0_FOR_8_20_AND_7_85_4.zipwhen using the wrapper without the scheduler, references to used delegates have to be stored ! Additionally WrappedDouble, WrappedInt and WrappedString objects are introduced, they have to be used in order to interact with certain methods like pan_setneedle etc... These objects are needed, because WITHOUT a scheduler, the creation/deletion and updating of such variables isn't done automatically ! Additionally no more IEnumerables have to be used, if the scheduler isn't used ! here's an example, providing an overview on how to use the wrapper wihtout a scheduler and how the WrappedDouble is used :
using AcknexWrapper;
namespace NoSchedulerTest
{
public class Program
{
static void Main(string[] args)
{
// opening the engine
EngFun.engine_open(null, null);
// limit frame rate
EngVar.fps_max = 60;
// load an empty level
EngFun.level_load(null);
// create a player entity
Player player =
new Player(new Vector(100, 0, 0));
// create and keep the reference to the delegate as long as it is needed !
WrapperDelegateVoid onSpaceMethodDelegate =
OnSpaceMethod;
// assign the delegate to the EngVar variable
EngVar.on_space =
onSpaceMethodDelegate;
// create a panel
PANEL sliderPanel =
PANEL.pan_create(null, 1);
sliderPanel.SHOW = true;
sliderPanel.size_x = 300;
sliderPanel.size_y = 100;
// allow mouse interaction
EngVar.mouse_mode = 4;
// create bitmaps, to be used in the slider
BMAP sliderBackground =
BMAP.bmap_createblack(200, 40, 24);
BMAP sliderKnob =
BMAP.bmap_createblack(20, 60, 24);
sliderBackground.bmap_fill(new Color(255, 255, 255), 100);
// the value to be read and modified by the user AND the engine
WrappedDouble wrappedDouble =
new WrappedDouble(50);
// create the slider
sliderPanel.pan_setslider(
0,
50,
50,
sliderBackground,
sliderKnob,
0,
255,
wrappedDouble);
bool keyEnterHasBeenReleased = true;
while (EngFun.engine_frame() != 0)
{
// interaction in the rendering loop
if (EngVar.key_enter == true)
{
if (keyEnterHasBeenReleased == true)
{
EngVar.sky_color.blue += 25;
EngVar.sky_color.blue %= 255;
keyEnterHasBeenReleased = false;
}
}
else
{
keyEnterHasBeenReleased = true;
}
EngVar.sky_color.red = wrappedDouble.Value;
}
EngFun.engine_close();
}
// interaction using EngVar key events
private static void OnSpaceMethod()
{
EngVar.sky_color.green += 25;
EngVar.sky_color.green %= 255;
}
}
public class Player
{
private readonly ENTITY PlayerEntity;
/// <summary>
/// the delegate has to be referenced to, as long as it is used !
/// </summary>
private readonly WrapperDelegateVoid PlayerRoutineDelegate;
public Player(Vector position)
{
// create the entity
this.PlayerEntity =
ENTITY.ent_create("_CUBE.MDL", new Vector(100, 0, 0), null);
// enable triggering of the event function, every frame !
this.PlayerEntity.ENABLE_FRAME = true;
// create and store the delegate
this.PlayerRoutineDelegate =
this.PlayerRoutine;
// assign the event method/delegate
this.PlayerEntity.event_ =
this.PlayerRoutineDelegate;
}
// interaction using on_frame
private void PlayerRoutine()
{
double speedOfPositionChange =
2.5 * EngVar.time_step;
if (EngVar.key_a == true)
{
this.PlayerEntity.y += speedOfPositionChange;
}
if (EngVar.key_d == true)
{
this.PlayerEntity.y -= speedOfPositionChange;
}
if (EngVar.key_w == true)
{
this.PlayerEntity.z += speedOfPositionChange;
}
if (EngVar.key_s == true)
{
this.PlayerEntity.z -= speedOfPositionChange;
}
}
}
}
|
|
|
Re: C# wrapper 2.3.0 - RELEASE
[Re: 3dgs_snake]
#376373
07/02/11 10:38
07/02/11 10:38
|
Joined: Feb 2005
Posts: 3,687 Hessen, Germany
Tempelbauer
Expert
|
Expert
Joined: Feb 2005
Posts: 3,687
Hessen, Germany
|
Dein Wrapper ist immer Top-aktuell. Das ist auch wichtig für jeden der ihn einsetzt. Gibt andere Engines, da wird ein solches Projekt gestartet, nach einigen Monaten wieder fallen gelassen und dessen Nutzer sitzen dann auf dem Trockenen Vielen Dank für den kontinuierlichen Einsatz und die regelmäßigen Updates Beteiligt sich Conitec eigentlich mittlerweile an der Entwicklung (sei es mit Manpower oder mit anderweitigen Entlohnungen)? Ein solcher Wrapper ist ja auch eines derer Interessen...
|
|
|
Re: C# wrapper 2.3.1 - RELEASE
[Re: Stromausfall]
#376981
07/08/11 12:28
07/08/11 12:28
|
Joined: Dec 2002
Posts: 616 Austria
Stromausfall
OP
User
|
OP
User
Joined: Dec 2002
Posts: 616
Austria
|
a new version was uploaded (for Acknex 7.85.4 AND Acknex 8.10) the update of the wrapper includes: this update includes: - missing PhysX functions included : pXent_rotate, pXent_setbodyflag, pXent_setbodyflagall (thanks to pararealist !) here's the link: AcknexWrapper_2_3_1_FOR_8_20_AND_7_85_4.zip
|
|
|
Re: C# wrapper 2.3.1 - RELEASE
[Re: Stromausfall]
#379281
07/31/11 17:01
07/31/11 17:01
|
Joined: Nov 2007
Posts: 2,568 Germany, BW, Stuttgart
MasterQ32
Expert
|
Expert
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
|
Hey! I have to say again: Great Work! But would it be possible to create a fluent interface for the vector things?? Because coding would be much easier then:
Old way:
Vector direction = new Vector(activeCCharacter.Position);
direction.vec_sub(EngVar.target);
direction.vec_normalize(5);
New Way:
Vector direction = new Vector(activeCCharacter.Position).vec_sub(EngVar.target).vec_normalize(5);
Sure it's not to hard to implement this. Afak the only thing to change is the return type of those vector functions.... Another thing, but i think it's too late for that: We have object orientation so we can't simply call the function create of a BMAP with an ENTITY. My thought is: Why to use those prefixes?? This would be much nicer: ENTITY myEnt = ENTITY.create("pla",pla,pla);Or even better: ENTITY myEnt = new ENTITY("pla",pla,pla);Would be cool to see this. Greetz Felix
|
|
|
Re: C# wrapper 2.3.1 - RELEASE
[Re: Stromausfall]
#379440
08/02/11 15:10
08/02/11 15:10
|
Joined: Dec 2006
Posts: 434 UK,Terra, SolarSystem, Milky W...
pararealist
Senior Member
|
Senior Member
Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
|
I agree with Stromausfall.
With those changes the wrapper will have a higher learn curve, where as now if you know lite-c, the wrapper is no problem, and it is an acknexwrapper after all.
A8.3x Commercial, AcknexWrapper and VS 2010 Express ○pararealist now.
|
|
|
|