Mark Sibly

Forum Replies Created

Viewing 15 posts - 406 through 420 (of 1,431 total)
  • Author
    Posts
  • in reply to: Ted2Go IDE #11081

    Mark Sibly
    Keymaster

    Think you’ve got startswith/endswith mixed up wrt: the ‘*’ filter.

    Also, just added a tiny regex module called tinyregex to develop branch if that’s useful. Only one function for now: Function re_match:Int( pattern:CString,text:CString ), returns index of match or -1 for no match.

    Just discovered the c++11 std library actually has a regex engine which may or may not be better, but is at least guaranteed to be bigger! I’ll look at implmenting this later if necessary.

    Regex’s aren’t quite like yer standard file filters though, think I prefer plain file filters. Maybe * in filter could be replaced with .* or something before being regexed?

    in reply to: Android Permissions #11079

    Mark Sibly
    Keymaster

    Also, can you let me know what you want to do with external storage?

    There are a lot of directories and APIS involved and I just wanna know what to concentrate on first.

    in reply to: Android Permissions #11075

    Mark Sibly
    Keymaster

    A version of this has been pushed to the develop branch of github. It will also be included in the v1.1.08 release due in a few days, so you can just wait for that if you want.

    Here it is in action, hopefully pretty straightforward:

    You might also want to read up on runtime permissions – was certainly news to me!

    https://developer.android.com/training/permissions/requesting.html

    You apparently only need to do this if targetSDK is >=23, which it is in the default manifest for monkey2 projects. So one way to avoid all this I guess is to just change targetSDK to 22!

    Thanks to CopperCircle for pointing me in the right direction.

    in reply to: Looping through list and this? #11063

    Mark Sibly
    Keymaster

    ‘Self’ is a reference to the ‘current object’ inside methods and properties, much like ‘this’ in c++/java etc. Is this what you mean? You could use it like this:

    in reply to: Mojo3D Vertex animation/morphing – how? #11051

    Mark Sibly
    Keymaster

    I’m probably being dim, but I don’t get why you don’t have to multiply by pitch, for the destination address.

    Good question!

    Like c/c++, monkey2 pointer addition/subtraction takes the size of the data actually pointed to into account. So ‘p+10’ where p is an int ptr will actually add 40 to p, as ints are 4 bytes long. Ditto p[10] will reference the memory at address ‘p+40’ (using [ ] with pointers is just a special type of pointer addition).

    However, libc.memcpy doesn’t know anything about types, it just takes void ptrs and a byte size. Monkey2 ‘fixes’ the pointer params, but not the size so you need to premultiply it by pitch.

    It might be an idea to add some ‘typed’ memcpys somewhere, eg:

    This way, you dont’t have to premultiply count by pitch, so the SetVertices code is even simpler.

    in reply to: Extention New(blah:String) allowed or not? #11050

    Mark Sibly
    Keymaster

    Not currently allowed.

    in reply to: Accelerometer class with low pass filter #11036

    Mark Sibly
    Keymaster

    Very nice!

    in reply to: Android Permissions #11035

    Mark Sibly
    Keymaster

    I actually meant the native target MonkeyActivity java class – my version doesn’t have the onPermissionsReply method.

    Ditto it’s not supported via the delegate mechanism. It’s easy enough to add, just wondering if I  missed a trick somewhere. I hate having to continually mung up the core Activity class each time we find something else that needs to be delegated out. It’s a pretty crappy design on the part of Android IMO.

    in reply to: Android Permissions #11028

    Mark Sibly
    Keymaster

    Ok, just adding a permission module now.

    Thanks for the sample code coppercircle. Am I correct in thinking you also has to add the permissions callback to AppDelagate and main Actitiy class?

    in reply to: Mojo3D Vertex animation/morphing – how? #11027

    Mark Sibly
    Keymaster

    Fixed in develop branch.

    in reply to: Mojo3D Vertex animation/morphing – how? #11013

    Mark Sibly
    Keymaster

    should I make a reproducable example, or is this expected?

    Example please, just had a quick look and can’t see anything obviously wrong.

    in reply to: Mojo3D Vertex animation/morphing – how? #11005

    Mark Sibly
    Keymaster

    Ok, finally got around to doing something here.

    The latest develop branch includes new versions of VertexBuffer and IndexBuffer and a new ‘Renderable’ entity class.

    There’s also a ‘morpher.monkey2’ in mojo3d/tests dir that shows you how to create your own renderable entity classes. It’s hopefully quite sensible:

    Basically, renderers need to implement OnRender() which is passed a ‘RenderQueue’ which you can add render ops to.

    A render op is basically a combination of material,instance,vertexbuffer,indexbuffer and draw count etc.

    Batching render ops like this allows for multiple render passes if necessary without having to call OnRender multiple times. It also potentially allows for ‘state sorting’ (doesn’t do that yet), better instancing using GL extensions (doesn’t do that yet either), and potentially culling. The render ops are also used to render shadow maps if Renderable.CastsShadow is true.

    Renderable is now used by Model, Sprite and ParticleSystem, although there’s a big kludge in there for Sprites.

    OnRender is called once per camera, and will probably get a camera param at some point. It would also be possible to have a ‘baked’ renderqueue that was camera independant and didn’t have to be rebuilt all the time.

    Note that custom Renderers like this must manage vertex/index buffers themselves (as above), although ‘helper’ classes could easily be added. Renderer is as simple as possible.

    I also modified/simplified vertex/index buffers quite a bit. They are now (mostly) statically sized and ‘lockable’. There’s a convience Resize() in there, but they no longer act like mini-stacks, ie: no more AddVertices. Mesh should be pretty much the same though, so as long as you’ve been using tha6t you should be OK. Didn’t have to change meshprims.monkey2 anyway.

    in reply to: Android Permissions #11004

    Mark Sibly
    Keymaster

    Can you post/attach the manifest file here?

    in reply to: Transform mouse coordinates to local space #10973

    Mark Sibly
    Keymaster

    Actually, the simplelight banana shows you how to do this…it does a funky rotate/distort of the view and converts mouse coords to ‘local’.

    in reply to: Transform mouse coordinates to local space #10972

    Mark Sibly
    Keymaster

    Same idea, just transform the point directly, something like:

    Note the minus sign before canvas.Matrix. This negates the current canvas matrix, so gives you the inverse transform.

Viewing 15 posts - 406 through 420 (of 1,431 total)