Search Results

Search found 45 results on 2 pages for 'resting'.

Page 1/2 | 1 2  | Next Page >

  • How to calculate new velocities between resting objects (AABB) after accelerations?

    - by Tiedye
    lately I have been trying to create a 2D platformer engine in C++ with Direct2D. The problem I am currently having is getting objects that are resting against each other to interact correctly after accelerations like gravity have been applied to them. Right now I can detect collisions and respond to them correctly (I think) and when objects collide they remember what other objects they're resting against so objects can be pushed by other objects (note that there is no bounce in any collisions so when objects collide they are guaranteed to become resting until something else happens). Every time the simulation advances, the acceleration for objects is applied to their velocities (for example vx += ax * t, where t is time elapsed since last advancement). After these accelerations are applied, I want to check if any objects that are resting against each other are moving at different speeds than their counterparts (as different objects can have different accelerations) and depending on that difference either unlink the two objects so they are no longer resting, or even out their velocities so they are moving at the same speed once again. I am having trouble creating an algorithm that can do this across many resting objects. Here's a diagram to help explain my problem

    Read the article

  • How to make a stack stable? Need help for an explicit resting contact scheme (2-dimensional)

    - by Register Sole
    Previously, I struggle with the sequential impulse-based method I developed. Thanks to jedediah referring me to this paper, I managed to rebuild the codes and implement the simultaneous impulse based method with Projected-Gauss-Seidel (PGS) iterative solver as described by Erin Catto (mentioned in the reference of the paper as [Catt05]). So here's how it currently is: The simulation handles 2-dimensional rotating convex polygons. Detection is using separating-axis test, with a SKIN, meaning closest points between two polygons is detected and determined if their distance is less than SKIN. To resolve collision, simultaneous impulse-based method is used. It is solved using iterative solver (PGS-solver) as in Erin Catto's paper. Error-correction is implemented using Baumgarte's stabilization (you can refer to either paper for this) using J V = beta/dt*overlap, J is the Jacobian for the constraints, V the matrix containing the velocities of the bodies, beta an error-correction parameter that is better be < 1, dt the time-step taken by the engine, and overlap, the overlap between the bodies (true overlap, so SKIN is ignored). However, it is still less stable than I expected :s I tried to stack hexagons (or squares, doesn't really matter), and even with only 4 to 5 of them, they would swing! Also note that I am not looking for a sleeping scheme. But I would settle if you have any explicit scheme to handle resting contacts. That said, I would be more than happy if you have a way of treating it generally (as continuous collision, instead of explicitly as a special state). Ideas I have tried: Using simultaneous position based error correction as described in the paper in section 5.3.2, turned out to be worse than the current scheme. If you want to know the parameters I used: Hexagons, side 50 (pixels) gravity 2400 (pixels/sec^2) time-step 1/60 (sec) beta 0.1 restitution 0 to 0.2 coeff. of friction 0.2 PGS iteration 10 initial separation 10 (pixels) mass 1 (unit is irrelevant for now, i modified velocity directly<-impulse method) inertia 1/1000 Thanks in advance! I really appreciate any help from you guys!! :) EDIT In response to Cholesky's comment about warm starting the solver and Baumgarte: Oh right, I forgot to mention! I do save the contact history and the impulse determined in this time step to be used as initial guess in the next time step. As for the Baumgarte, here's what actually happens in the code. Collision is detected when the bodies' closest distance is less than SKIN, meaning they are actually still separated. If at this moment, I used the PGS solver without Baumgarte, restitution of 0 alone would be able to stop the bodies, separated by a distance of ~SKIN, in mid-air! So this isn't right, I want to have the bodies touching each other. So I turn on the Baumgarte, where its role is actually to pull the bodies together! Weird I know, a scheme intended to push the body apart becomes useful for the reverse. Also, I found that if I increase the number of iteration to 100, stacks become much more stable, though the program becomes so slow. UPDATE Since the stack swings left and right, could it be something is wrong with my friction model? Current friction constraint: relative_tangential_velocity = 0

    Read the article

  • Log php errors in ubuntu

    - by resting
    I followed the setup here: Where is the PHP error log When I look into /var/log/php_errors.log, I could see some PHP errors. PHP Warning: file_get_contents(/var/www/...): failed to open stream: No such file or directory in ... But what I'm trying to see is the error when I removed a semicolon from a statement. That error above has no relation to file from where I removed the semicolon so we can just ignore that. When I access the page with the removed semicolon, I get The website encountered an error while retrieving https://myapp/download/decode/testfile. It may be down for maintenance or configured incorrectly. HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request. But no logs in /var/log/php_errors.log. How do I see the error that usually says which line and which file the process failed? The real reason for trying to see the error is because I have a very huge loop, that throws the HTTP 500 error and I can't see the exact error. I'm just simulation with a removed semicolon to test things out. Other settings: error_reporting = E_ALL & ~E_DEPRECATED display_errors = On On Ubuntu 10.04.4 LTS Update Ok, I managed to get the error message to display. Parse error: syntax error, unexpected T_IF in ... However, it's still not logged. It wasn't displaying previously because Cakephp's debug level was at 0. Setting it to 2 displays the message, but no logs.

    Read the article

  • Advise how to write a simple test for this javascript snippet?

    - by resting
    I'm trying to start unit testing (not using any testing frameworks) for my javascripts. Here's one example of it. var obj = {}; obj.disableBtn = function ($btn, style) { $btn.attr('disabled','disabled').addClass('disabled').removeClass(style); }; The use case is as such: obj.disableBtn($('.submit'), 'btn-blue'); What it does is simply add the disabled attribute, add the disabled class, and remove the btn-blue style. Please advise how would a typical test case look like in this case. I have a little knowledge on testing using assert(), but have no idea how to go about it when it involves verifying the result on HTML elements.

    Read the article

  • Native PHP vs exec()

    - by resting
    Just wondering, assuming no security issues, that is, you're in total control of the command passed to exec(), is there a difference (in terms of speed or standards) between using exec() vs native PHP? Example just to name a few use cases: Using the DirectoryIterator vs exec(ls -1, $output), to list all files. List 100 files from the 99th file onwards (that is, file 100 to 199) Count total number of files in directory.

    Read the article

  • How do I create regex groups for replacement?

    - by resting
    I have this sample string: Image: SGD$45.32 SKU: 3f3f3 dfdfd grg4t BP 6yhf Pack Size: 1000's Color: Green Price: SGD$45.32 SGD$45... I would like to remove all the prices namely: SGD$45.32 Price: SGD$45.32 SGD$45 I have this expression thats supposed to match the 3 groups: $pattern = '/(Price.+\sSGD\$\d+\.\d{2})(SGD\$\d+\.\d{2})(SGD\$\d+)/'; $new_snippet = preg_replace($pattern, '', $snippet);` But apparently its not working. It works if I replace a single group at a time. But, I'd like to know if it possible to replace all possible matching groups with a single statement. Tried preg_match_all($pattern, $snippet, $matches); to show matches based on the above pattern, but no matches are found if I put all 3 groups together.

    Read the article

  • I need help with 2D collision response (of stacking rotating polygons, with friction and gravity, for a game)

    - by Register Sole
    Hi I am looking for suggestions on how to write a collision response for game programming purpose (so not a scientific simulation). I am dealing with 2D polygons that are rotating, and I want them to be able to stack. I also want friction and gravity. I have a detection mechanism that returns the separating axis, how long the polygons are overlapping, and up to 2 points of contact. For the response, I am currently using an impulse-based response, which main idea is: find the separating axis, length of overlap, and the point of contact (if there are two, pick a random point between to simulate averaged force. i believe there are better ways than this) separate the object (modifying their positions, taking into account of their masses. i do not separate them completely though, to keep track that they are colliding to reduce jitter) calculate normal force based on the coefficient of restitution as if there is no friction. calculate friction, as if there is no normal force. I also assume that the direction of the friction is the same throughout the collision. apply the two forces (which result in a rather inaccurate result, since each force is calculated as if the other is not present. for non-rotating bodies though, this method is exact) I am aware that this method requires the coefficient of friction to be sufficiently small due to the assumption that the direction of friction stays the same in a collision. Also, the result is visually satisfying if gravity is not present. However, when there is gravity, objects on ground jitter and drift (even with zero coefficient of restitution)! It also happens for stacking objects. Larger coefficient of restitution and gravity increase the jittering. I hope you can help me with this. Some things i would like to know more about is how to handle collision with two point of contacts (how to end up having an object sitting still on the ground?), how to reduce, and prevent if possible, jitter and drift (do people use the most accurate method possible, or is there a trick to overcome this?), and how to handle multiple objects collision (for example, in the case of stacking objects, how do I check collisions between all of them and keep them all stable at every frame so they don't jitter?). A total reformulation of my algorithm is also welcomed, as long as it works. Another thing to note is that I am not making a Physics game, so I only need a visually satisfying response (though a realistic response is preferable, if it is not performance-heavy). But surely jittering and drifting objects on flat ground are not at all acceptable. In addition, I am a Physics student, so feel free to talk about impulse and whatever needed. Finally, I'm sorry for the long post. I tried to be as concise as I can. Thank you for reading it! EDIT It seems what I didn't manage to come up all this time is to separate resting contact as a class of its own and how to solve them. Currently reading the paper suggested by Jedediah. More suggestions on the topic are welcome :) CASE CLOSED After reading various papers referenced in the paper, successfully implemented simultaneous impulse method (referring to the original paper by Erin Catto, [Catt05]). Thanks maaaan!! The paper is wonderful. The current system is visibly much better than the previous. Still haven't separated resting contact as a class of its own though, which brings me to my next question. Love you all! Haha (sorry, I'm just so happy thanks to you).

    Read the article

  • Classification: Dealing with Abstain/Rejected Class

    - by abner.ayala
    I am asking for your input and/help on a classification problem. If anyone have any references that I can read to help me solve my problem even better. I have a classification problem of four discrete and very well separated classes. However my input is continuous and has a high frequency (50Hz), since its a real-time problem. The circles represent the clusters of the classes, the blue line the decision boundary and Class 5 equals the (neutral/resting do nothing class). This class is the rejected class. However the problem is that when I move from one class to the other I activate a lot of false positives in the transition movements, since the movement is clearly non-linear. For example, every time I move from class 5 (neutral class) to 1 I first see a lot of 3's before getting to the 1 class. Ideally, I will want my decision boundary to look like the one in the picture below where the rejected class is Class =5. Has a higher decision boundary than the others classes to avoid misclassification during transition. I am currently implementing my algorithm in Matlab using naive bayes, kNN, and SVMs optimized algorithms using Matlab. Question: What is the best/common way to handle abstain/rejected classes classes? Should I use (fuzzy logic, loss function, should I include resting cluster in the training)?

    Read the article

  • On ubuntu 10.04, what is the recommended RoR stack?

    - by Kurucu
    I can't find clear answers / methods on this. As seen elsewhere, passenger and RoR under apache gobble up ram on my VPS. I've tried a multitude of stacks and implementations, currently resting on a sub optimal apache/cgi/rails configuration, which has swapped my ram usage for CPU time and slow response to requests. Can anyone recommend an efficient and preferably simple to administer method of setting up rails apps in ubuntu 10.04 server?

    Read the article

  • Auto-tiling with Yoshi's Island style tiles

    - by Boreal
    I'm creating a 2D platformer and I'd like to implement an auto-tiling system. Normally, this wouldn't be particularly difficult. However, I'd like to have tiles like in Yoshi's Island, where the graphics extend past the actual collidable tile's boundaries. Consider this image: Although the eggs and the Piranha Plant are clearly resting on the ground, the flower tiles continue behind them, out of the collidable tile. I know that it would be simple to do by hand, but extremely time consuming. Using an auto-tiling algorithm would save me a lot of time and boredom, but I'm not sure where to start.

    Read the article

  • In Search of Automatic ORM with REST interface

    - by Dan Ray
    I have this wish that so far Google hasn't been able to fulfill. I want to find a package (ideally in PHP, because I know PHP, but I guess that's not a hard requirement) that you point at a database, it builds an ORM based on what it finds there, and exposes a REST interface over the web. Everything I've found in my searches requires a bunch of code--like, it wants you to build the classes for it, but it'll handle the REST request routing. Or it does database and relational stuff just fine, but you have to build your own methods for all the CRUD actions. That's dumb. REST is well defined. If I wanted to re-invent the wheel, I totally could, but I don't want to. Isn't there somebody who's built a one-shot super-simple auto-RESTing web service package?

    Read the article

  • AppFabric &ndash; where are all the monitoring events?

    - by Shawn Cicoria
    When you’ve just gone through a setup of AppFabric and you’ve got some WF/WCF things happening, if you start looking at the Dashboard and you see nothing, it might be as simple as restarting SQL Agent. I generally don’t reboot my system for several days and after installing AppFabric the SQL Agent jobs didn’t start firing right away.  Yes, even running a boot to VHD, you can still put the machine to sleep (just logoff and click on Sleep)… So, after spending time looking through the SQL monitoring DB that AppFabric was configured to use, I saw a bunch of records in the [AppFabric_Monitoring].[dbo].[ASStagingTable] table.  This table is the stopping point before the SQL Agent job (or Service Broker in SQL Express) pushes the items to their final resting place. This post goes through a few things to check on AppFabric monitoring http://social.technet.microsoft.com/wiki/contents/articles/appfabric-items-to-check-when-configuring-appfabric-monitoring.aspx Of course, during development you might want to clean up regularly For that there’s the PowerShell command Clear-AsMonitoringSqlDatabase -Database AppFabric_Monitoring

    Read the article

  • Chemical alternatives to caffeine / coffee for mental clarity and alertness? [on hold]

    - by einsteinx2
    Currently I drink about 2 cups of coffee or tea a day (one in the morning and one in the afternoon usually). However I'm very sensitive to stimulants and drinking caffeine regularly keeps my resting heart rate really high, causes occasional heart palpitations, and sometimes trouble sleeping. I've tried going without coffee, and while I can do it, I have trouble concentrating at work and even just enjoying my work. I'm borderline ADD (or possibly full on ADD, but haven't been checked). And I tend to lose focus easily if I don't have some coffee or tea in me. For health reasons, I'd like to cut it out completely, but when I do my work performance seriously suffers. I already work out (cardio and/or weight lifting) 5 - 6 days a week, and get an average of about 8 hours of sleep, but I still can't focus throughout the day without caffeine. Are there any over the counter chemical or supplement alternatives for mental clarity that you've used with success don't cause the additional unwanted physical side effects that come with regular stimulants like caffeine?

    Read the article

  • Change Tweetmeme button colour under wordpress

    - by Andrew Bolster
    I've had a poke around in the TweetMeme plugin code and IANA JS Guru, but I cant find any sensible way to make specific styling changes; you can add div-specific CSS characteristics, but I'm talking about changing the resting colour and the hover colour of the button. I've googled around and noone seems to have asked it on here so I thought I should.

    Read the article

  • Configurying load test in visual studio

    - by Sergej Andrejev
    I'm creating a load test in visual studio. Could somebody help me choose the settings right. What I want is to test application with 1 user then give it a rest for two minutes, then test with 4 and so on. Also after resting for 2 minutes I would like user load increased gradually.

    Read the article

  • Beeping Hard Disk - Seagate 250GB Momentus 5400.6

    - by Pez Cuckow
    I have been trying to repair a laptop that simply beeps instead of booting. After taking it apart I have now realised that it is the hard disk beeping. I know that may sound strange but I guarantee that is what it is! (Currently powered on it's own with a Sata Mains lead). The beeping is slightly faster than one per second there is a link to this recording. This recording was made resting the mic on the hard disk while it was sat on a table on it's own, there are no speakers anywhere near, the sound is coming from the hard disk. Does anyone know what this beep means? Is the hard drive just dead, or is it fixable and the data recoverable? Many thanks,

    Read the article

  • Change Tweetmeme button colour under wordpress

    - by Andrew Bolster
    I've had a poke around in the TweetMeme plugin code and IANA JS Guru, but I cant find any sensible way to make specific styling changes; you can add div-specific CSS characteristics, but I'm talking about changing the resting colour and the hover colour of the button. I've googled around and noone seems to have asked it on here so I thought I should. PS I would not be surprised by this question being migrated to SO, but since this is more of a design/use question rather than a programming question, I thought it was worth trying here first.

    Read the article

  • Beeping Hard Disk - Seagate 250GB Momentus 5400.6

    - by Pez Cuckow
    I have been trying to repair a laptop that simply beeps instead of booting. After taking it apart I have now realised that it is the hard disk beeping. I know that sound strange but I guarantee that is what it is! (Currently powered on it's own with a Sata Mains lead). The beeping is slightly faster than one per second there is a link to a recording below: http://www.pezcuckow.com/files/BeepingHardDisk.m4a This recording was made resting the mic on the hard disk while it was sat on a table on it's own, there are no speakers anywhere near, the sound is coming from the hard disk. Does anyone know what this beep means? Is the hard drive just dead, or is it fixable and the data recoverable? Many thanks,

    Read the article

  • When browsing a specific network share remotely, Windows Explorer continuously jumps back to the parent folder

    - by Evil Pigeon
    I am accessing a specific network path on another domain. It looks something like this: \\CoputerName.OtherDomain.in\c$\Inetpub\Testing\Website\ In under 30 seconds, I am automatically jumped back to \\CoputerName.OtherDomain.in\c$\Inetpub\Testing\ In less time it then jumps back to \\CoputerName.OtherDomain.in\c$\Inetpub\ Then it jumps back to c$ for its final resting place. \\CoputerName.OtherDomain.in\c$\ At first I thought this had to with a faulty keyboard, but this behaviour also occurs when the window does not have focus. It's as if windows thinks that the folder no longer exists (as in someone else has deleted or moved it). This behaviour is not specific to my PC either, it occurs from other machines in the office. Edit: It looks like this issue only occurs from other Windows 7 machines. There are no issues accessing the path from XP.

    Read the article

  • Hibernate speed, and hard drive temperature

    - by cometbill
    My computer is taking in the region of 4 minutes or so, to hibernate 4GB of RAM. Also, resting my hand on the top of it is rather hot to the touch, so I ran CrystalDisk Info and that is reporting a temperature of 49 degrees C. I It's a Western Digital 5400 rpm drive, I've had it in the laptop since I bought it for most of the 2.75 years I've had it. Power on Count is 1219 Power on Hours is 3940 hours Boot up time is quicker than resuming from hibernate, too. Is there anything I can / should check ? Advice is greatly appreciated.

    Read the article

  • Dr. Robert Ballard: Special Guest at Java Strategy Keynote Sunday

    - by Tori Wieldt
    Dr. Robert Ballard, famed explorer who found the Titanic at its final resting place, will be at the Java Strategy Keynote on Sunday. Among the most accomplished and well known of the world's deep-sea explorers, Dr. Ballard is best known for his historic discoveries of hydrothermal vents, the sunken R.M.S. Titanic, the German battleship Bismarck, and numerous other contemporary and ancient shipwrecks around the world. During his long career he has conducted more than 120 deep-sea expeditions using the latest in exploration technology, and he is a pioneer in the early use of deep-diving submarines. You can learn more about Dr. Ballard and undersea exploration at National Geographic and TED. The first 1,000 people to arrive at the JavaOne Keynote hall on Sunday will receive a copy of Dr. Ballard's TV show "The Alien Deep" on Blu-Ray. The Alien Deep explores the sea, thousands of feet beneath the surface, far from the first crack of light, where the planet’s last and greatest secrets hide in the cold darkness of endless night. Viewers get to see underwater worlds via submersible where no one has gone before. The JavaOne Strategy Keynote is on Sunday at 4:00pm PT at Masonic Auditorium, 1111 California Street. See you there!

    Read the article

1 2  | Next Page >