In the original Box2D API, the WeldJointDef class has two Attributes that I couldn't find in the LibGdx gdx.physics.box2d.joint.WeldJointDef class which are:
- frequencyHz.
- DampingRatio.
modifying these two attributes give more flexibility to the joint.
Is there any way to access these attributes ?
LibGdx gdx.physics.box2d.joints.WeldJointDef
These features have been added to the LibGdx API.
Related
I am having trouble using the Cesium.Material.fromType function to create a material using a type and uniforms.
I am referring to the docs here: link
I have the following example I am trying to get to work, however I would like to next use the Dot dynamic type not color. Color seems easier for the moment.
Sandcastle example
This works:
material : Cesium.Color.GREEN
This does not:
material : Cesium.Material.fromType('Color', {
color : new Cesium.Color(1.0, 0.0, 0.0, 1.0)
})
I am getting this error:
Uncaught DeveloperError: Unable to infer material type: [object Object]
It seems like the material property on entities cannot be an object, am I missing a step to convert the material into a primitive type?
So I don't have great news here, but I can at least explain what's wrong. As you know Cesium has two separate API layers, the "Entity" layer (for complex objects like moving vehicles), and the "Primitive" layer (for graphics primitives, like collections of billboards or meshes). What you're doing here is directly constructing a material from the Primitive layer and trying to assign it to an Entity, which will not work.
At the Entity layer, materials are described by a class derived from the abstract base class of MaterialProperty. The derived classes are all Entity-layer classes listed in that doc link, for example there's a ColorMaterialProperty class for solid colors. Being at the entity layer makes these things time-dynamic, so for example your solid color could be blue when the simulation time is at 04:00 and change to red at 06:00, etc. Primitive materials do not have a concept of time baked in and are much lighter-weight as a result.
And now the bad news: There doesn't appear to be a DotMaterialProperty class in Cesium currently. This means the Dot material exists only at the primitive layer API and is not hooked up to the entity layer. The team likes to say "contributions welcome" at this point, and if you were so inclined you could probably get this hooked up by copying either StripeMaterialProperty or GridMaterialProperty and editing it to hook up to Dot.
But in the short term, if you need the Dot material more than you need the Entity layer, you could transition your code over to graphics primitives. You can find sample code for this in the Material Sandcastle Demo under the Procedural Textures drop-down box.
I'm looking for a list of flash.include.whatever.whatever for as3.
If no one knows a list then can someone tell me the flash.include to use for drawing rectangle with the startFill and endFill things? Thanks for any help.
I didn't find anything on either of these googling, and the place I got the code for drawing a rectangle of course didn't have the flash.includes included in the example code... is their a reason so many people do that? Any way I can get around it?
Do you mean you want a list of the packages and classes that come with AS3? That is typically called the documentation and can be found here:
Adobe ActionScript® 3 API Reference
For drawing a Rectangle, you can start at flash.display.Shape. It has a graphics object with the methods .beginFill() and .endFill().
you can using a Graphics.
The Graphics class contains a set of methods that you can use to
create a vector shape. Display objects that support drawing include
Sprite and Shape objects. Each of these classes includes a graphics
property that is a Graphics object. The following are among those
helper functions provided for ease of use: drawRect(),
drawRoundRect(), drawCircle(), and drawEllipse(). You cannot create a
Graphics object directly from ActionScript code. If you call new
Graphics(), an exception is thrown.
The Graphics class is final; it cannot be subclassed.
here is a sample
import flash.display.*;
this.graphics.beginFill(0xff0000);
this.graphics.drawRect(0,0,100,100);
here is a Adobe Tutorial
AS3 all display class list here
You do not necessarily need to default AS3 include. fine compile. But include only the code you can see the hint. perhaps, CS4 after that if you use a specific class will automatically include. or ctrl+space is autocompletion.
As follows by default when you install the flash is because of the SWC path.
As per I know, there is not such a thing like Flash.include. May be you're trying to ask something else or may be i am still unknown about this feature.
If you found any positive thing about this, please let me know, i want to know that new thing.
I am a newbie regarding three.js and I have a problem with imported geometry (js-file from 3dsmax inclusive all material and textures) and the CanvasRenderer. The CanvasRenderer displays the triangle edges of imported geometry, the WebGLRenderer works well.
Canvas example:
http://der-n.square7.ch/threejs/examples/teapot_canvas.html
WebGL example:
http://der-n.square7.ch/threejs/examples/teapot_webgl.html
In the three.js library I have found the option "overdraw: true" for a material to fix this behaviour but obviously the material+textures are defined by the above mentioned exported 3dsmax js-file.
For the tests I use the "misc_camera_trackball" example with small changes (I have added a JSONLoader, changed some camera and trackball parameters, changed some light colors, added a CanvasRenderer)
Any hints how to solve this?
Thanks for your help.
Best regards
Oggy
In the loader callback, you have all of the loaded materials in an array geometry.materials. You could loop over those materials and set the overdraw property to true for each.
As far as I know, THREE.MeshFaceMaterial is just a pass-through material that indicates "faces have an index that points to a material instance to use from the geometry's materials array", so setting properties for MeshFaceMaterial won't have any effect.
I'm developing a Hex based Game. Having wrestled with the limitations of the C# type system, on discovering Scala I knew I had to rewrite the application in Scala. I need a basic GUI to be able to develop the main functionality. I've been using a WPF Canvas with Polygon class. I also use Wpf Border class and Line class on the Canvas. I don't need most of the functionality of Wpf. I don't use Xaml. i just need to map the graphical objects to the desired coordinates, receive left and right mouse click events from them and put up tool tips and display context menus. I don't even need the Wpf context menu property as as I prefer to the context menus to be dynamic. I handle scrolling and zoom through my own code.
The best that I've found to make Polygons is the awt GeneralPath class. Although this is supposedly depreciated. I've started with Scala Swing, but the MainFrame class will not allow me to use the awt canvas class as content. Any help / recommendations appreciated
just override paint of some Component:
public class MyCanvasPanel extends JPanel{
...
#Override
public void paint(Graphics g){/* do your java2d stuff here*/}
}
hi i am developing a game using libgdx. I want to make the texture object available to entire application. I have a requirement like, initialize the texture in one application listener and i want to use it in another application listener. Can anyone help me on this.
There are two ways I think you can do this. First, you could read the data into a static variable. For an example of this, take a look at the Art class in metagun demo: Art.java. The second way, which I have not tried yet, is to use the new AssetManager class. There is example use in the AssetManager test. These should help you access your textures more easily.
You don't need to have 2 or more Application listeners. Actually that only makes things harder.
Use Screens instead (extending Game in your core class instead of directly implementing ApplicationListener).
Either way, you should be able to just send the textures as arguments. For example I have a class Assets that contains all the textures and I sent it to each screen. You can make them static as Doran suggested too.