Jump to content

ZioRed

Members
  • Posts

    1,133
  • Joined

  • Last visited

Posts posted by ZioRed

  1. Nice work, could be even nicer if you expose configuration settings to the plugin such as the SDK path (most plugins can use the SDK converters so we can write Forms to enable/disable the command-line options). If you would like to add the configuration settings, then it would be useful to allow a plugin to be configured too in the same option Form.

  2. That doesn't seem to have worked.

    I'm creating several physics bodies (as in the bodies tutorial) and out of the hundred, only one is affected.

     

    I tried against the code of the tutorial "Introduction to Models" and have 101 entities count using "ENTITY_MODEL | ENTITY_BODY":

     

    #include "engine.h"
    #include <cstdio>
    #include <sstream>
    
    int entities = 0;
    
    void _stdcall myfunc( TEntity entity, BP extra )
    {
    entities++;
    }
    
    inline float rnd( float min=0.0, float max=1.0 ) {
    return min + ((float)rand()/RAND_MAX)*(max-min);
    }
    
    int WINAPI WinMain( HINSTANCE hInstance,
    				HINSTANCE hPrevInstance,
    				LPSTR lpCmdLine,
    				int nShowCmd )
    {
    Initialize() ;
    RegisterAbstractPath("D:/LE/2.32");
    SetAppTitle( "ConsoleCPP" ) ;
    Graphics( 800, 600 ) ;
    
    TWorld world = CreateWorld() ;
    if (!world) {
    	MessageBoxA(0,"Error","Failed to create world.",0);
    	return Terminate();
    }
    
    TBuffer gbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL);
    
    	//Create a camera
    TCamera cam=CreateCamera();
    CameraClearColor(cam,Vec4(0,0,1,1));
    PositionEntity(cam,Vec3(0,2,-10));
    
    //Create a light
    TLight light=CreateDirectionalLight();
    RotateEntity(light,Vec3(45,45,0));
    
    //Create a render buffer
    TBuffer buffer=CreateBuffer(800,600,BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL);
    
    TModel model=LoadModel("abstract::oildrum.gmf");
    if (!model) {
    	MessageBoxA(0,"Error","Failed to load mesh.",0);
    	goto exitapp;
    }
    SetBodyMass(model, 1);
    
    for ( int n=1; n<=100; n++ ) {
    	model=CopyEntity(model);
    	PositionEntity(model,Vec3(rnd(-5,5),rnd(5,15),rnd(-5,5)));
    	RotateEntity(model,Vec3(rnd(0,360),rnd(0,360),rnd(0,360)));
    	SetBodyMass(model, 1);
    }
    
    //Main loop
    while(!KeyHit(KEY_ESCAPE))
    {
    	//Update the world
    	UpdateWorld();
    	//Render the scene
    	SetBuffer(buffer);
    	RenderWorld();
    	//Render lighting
    	SetBuffer(BackBuffer());
    	RenderLights(buffer);
    
    	entities = 0;
    	ForEachEntityDo(reinterpret_cast<byte*>(myfunc), 0, ENTITY_MODEL | ENTITY_BODY);
    
    	//std::string s;
    	std::stringstream out;
    	out << entities;
    	//s = out.str();
    	DrawText(0, 30, out.str().c_str());
    
    	//Swap the front and back buffer
    	Flip();
    }
    exitapp:
    return Terminate();
    }
    

  3. Is there a tutorial/guide somewhere to set up LE with C#?

    Visual Studio 2010 is looking fantastic.

    I don't know how will be different the code from the new incoming wrapper, but I wrote a "getting started" which used the 1.32 version of the wrapper (I don't think the new wrapper will be enough different to invalidate that tutorial or the other one I wrote for Lights, if needed I will update them when the new will be released).

  4. I have checked out the SVN version.

    When loading the solution in VS2010 it complains about a missing project file

    The new wrapper has been moved to Assembla, but it seems to be still under development and locked, so we cannot download it. If you want the source for the version 1.32.8 (latest before the new coming) I can send it to you, let me know. Else we need to wait for a stable release of the new wrapper.

  5. Well, in a struct you cannot declare default values for members which must be fully assigned in the constructor (but the constructor parameters can have a default value with NET 4.0), so I see it mostly unuseful too, except very rare cases in which you have only few variables and fewer methods (well a vector class has very few variables so it could be used).

  6. are there really some persons using dotNOT?

    Me for sure and may be few others coming.

     

    Are you really wasting a "Dual Intel Xeon X5670 (8 Cores : ~24GHz); 32 GB DDR3-1600 (ECC, Fully Buffered); PNY Quadro FX 4600 SDI 1536 MB GDDR3" with a Linux? :) ok stop the common OS war :P

  7. As promised I superficially tested the control and was able to select a mesh from a scene loaded in the control and update some TextBoxes and NumericUpDowns, if you're still interested you can download a sample program here (requires VC# 2010, it already contains the engine and wrapper DLLs in its debug directory so you need only to start debugging from the IDE or launch the compiled debug exe).

     

    In that example you can rotate the camera with holding the right button and select a mesh/terrain with left button.

     

    sceneeditor.th.png

     

    EDIT: the example assumes that your SDK folder is "C:\Leadwerks Engine SDK", else you need to change the code in the Init event of the control.

  8. It's a custom User Control which deeply use the C# wrapper classes. However the source is free available on the Google Code space (you should use a SVN client like TortoiseSVN to download the branch: /trunk/Leadwerks.Controls).

     

    EDIT: I'm writing some tutorials on C# in the C# Programming section of tutorials, more coming next.

     

    RE-EDIT: the thing you're speaking about (adjusting controls on a form when something happens on the LE's control) should be simple in C#, I would try something later since I need a kind of little editor too.

  9. I do not fully understand how this is possible though.

    Because SetPosition is a method and not a global function (LE's is PositionEntity) of a model object and your classes are not extending it but are new classes :)

  10. I am definitely not a senior game developer (I'm still newbie in game development), but I agree with someone else who said in another thread that currently LE is more a renderer engine than a game engine, and I think this is the focus of those negative comments. As pretty "game engine" LE still lacks some features that are exposed in many others, first but not last some AI and GUI specific. However I agree with Rick, probably most of the negatives' authors were probably non-programmers and the programmers among them were mostly complaining about a protracted period during which Josh did changes to the code invalidating something that worked before (and this seems to be true in the past as I read in many posts on this forum, even if I have no personal experience since I started with 2.31).

  11. @Ziored: I was thinking about that, but then I face a problem. This is the current function:

    --Place the button on an X and Y position. Also adjusts the position according to the resolution.
    function LuaGui:Position(x,y)
    
    self.buttonX  = x * self.scaleX
    self.buttonY  = y * self.scaleY
    end

     

    The x and y position are adjusted according to the resolution. If I remove these 2 lines, the correct position is no longer calculated. Perhaps I can fit it in the UpdateButton(). Thanks!

    I was only speaking about the name of the method, not its code content... I don't know very well how Lua works, perhaps there is already a global "SetPosition" method for any new object?

×
×
  • Create New...