Create ring ammo.js (three) - physics

Is it possible to create a RIGID (not elastic) ring with the help of Ammo.js?
I am trying to use btHingeConstraint, but this does not work well: https://prnt.sc/q3d7a5.

Found the answer - btCompoundShape.

Related

Set the gap for Gurobi.Optimizer in Julia-JuMP

I am trying to understand how to set the gap for Gurobi.Optimizer, because it solves too long when the default gap threshold is used (10e-4).
I couldn't find it anywhere (they might be referred to as attributes or parameters).
PS: Also, I am trying to find the right tutorial or instructions on how to use the solver in JuMP. I checked here https://juliahub.com/docs/Gurobi/do9v6/0.7.7, but they don't reveal the meanings of different attributes and inputs. Please, send me one in case somebody knows.
Best,
A.
You can set the MIP gap via the MIPGap parameter:
using JuMP, Gurobi
model = Model(Gurobi.Optimizer)
set_optimizer_attribute(model, "MIPGap", 0.1)
You can read more about JuMP here: https://github.com/jump-dev/Gurobi.jl

Using a Skewed Associative Cache in Gem5

I am trying to learn how to implement an L2 cache with a skewed associativity.
I see there is already implemented classes for skewed associativity (skewed_associative.cc/hh) under
/gem5/src/mem/cache/tags/indexing_policies/
and i would like to use this to start off with.
What I do not understand is how to access those files and specify a given cache to act as a skewed associative. Do I need to create an entire new cache class that inherits from the basecache? Or is there a way to do it through implementing a new tag?
I'm still trying to figure out how gem5 has anything structured/works, so any amount of help or links would be greatly appreciated.
The above comments helped lead to a solution.
When instantiating a given cache, assign its tags' indexing_policy as SkewedAssociative()
in configs/common/CacheConfig.py:
Instead of having:
system.l2 = l2_cache_class(clk_domain=system.cpu_clk_domain, **_get_cache_opts('l2', options))
you'd have
system.l2 = l2_cache_class(clk_domain=system.cpu_clk_domain, tags=BaseSetAssoc(indexing_policy=SkewedAssociative()), **_get_cache_opts('l2', options))

Procedural generated 2D caves/dungeons for sidescroller like game

I would like to proceduraly generate 2D caves. I already tried out using some 1D simplex noise to determine the terrain of the floor, which is basically everything you can change in a sidescroller, but it turned out rather unimpressive.
I would like to have an interesting terrain for my cave/dungeon and if possible some alternative paths.
I couldn't come up with any ideas for this kind of terrain and I also could not find any promising ways to do this kind of stuff on the internet.
Assuming you've tried something like abs(simplex) > 0.1 ? nocave : cave, maybe the problem you're running into is that it's too connected, and that there are no dead-ends anywhere. You could extend this by doing the following simplex1*simplex1 > threshold(simplex2) where threshold(t)=a*t/(t+b) where a roughly controls the max threshold (cave opening size) and b roughly controls how much of the underground is caves vs not. The function looks like this, and the fact that it quickly rushes to zero is supposed to make dead ends look more rounded and less pointy. Working with the squared noise value is also for this purpose.
Have you tried Perlin Noise? Seems to be the standard way of doing this sort of thing.

GPU info through Metal framenwork's registryID instance property

I'm searching for GPU information through the IO matching "IOPCIDevice" and should be nice to have info about Metal, i.e if is supported or not (I still support some years old MacPro). I see that Metal 2 has a new property called registryID and I've tried to match the IOIteratorNext, but it didn't. The code I use is just the same described here by #rsharma (credits goes to #trojanfoe) with little modifications.
So my question is: how can I use registryID to ensure is the same graphics card?
P.S. I already have an array of i/GPU that support Metal using MTLCopyAllDevices.
Given a registry entry ID, you can use IORegistryEntryIDMatching() to create a matching dictionary. You would then pass that to IOServiceGetMatchingService() (on the assumption that there's only one) or IOServiceGetMatchingServices() to retrieve the object.

How is a dynamically sized FIFO implemented in verilog

Say I would want to have a FIFO that does something like this:
local_max_fifo local_max_save
(
.clk (clk),
.rst (rst),
.din (local_max_in),
.dout (local_max_out),
.wr_en (local_max_write_data),
.rd_en (local_max_read_data)
);
Is there a way to do this so that all FIFOs in the project use the same fixed size memory pool? So I might have 10 FIFOs in my project but all 10 FIFOs use the same memory pool
Your question is not clear enough, at least to my understanding.
If what you are trying to accomplish is to use the same physical resource ( "THE FIFO" ) for 10 different computations you could use multiplexing, knowing that any data coming from the unselected channels will be lost. If that is what you are trying to do; using a control line with multiplexors should allow you to use the same physical FIFO. I am not sure if that is what you are looking for.